|
Try this instead:
X = str2num(get (hObject,'String')); % String, not value, then cast to
a numeric data type.
and then fix this second error:
fprintf (fid, '%d ',X1); % Not X, should be X1 which is the Hex.
Also, make sure X is correct, because I don't know that hObject is
correct. That would be the correct in the callback of the edit field,
but not if you were using it in the callback of a "Write to file"
button. In that case, you'd have to use the actual handle name of the
control, e.g. handles.editText1, rather than hObject because hObject
would refer to the button, not the edit text field.
|