How to fix this error?
Show older comments
Hi, I had facing this problem. I try to compute the GUI and it comes out this error.

Accepted Answer
More Answers (2)
KSSV
on 16 Dec 2020
If you want to open .fig file.
openfig('DSBSCfig.fig')
If you want to run the .m file, open it and press F5 or press the run button. Or you be in the directory where the DBSCfig.m file is present and type
DBSCfig
1 Comment
wyeen chow
on 16 Dec 2020
Cris LaPierre
on 16 Dec 2020
Edited: Cris LaPierre
on 16 Dec 2020
In checking your gui, the issue is you have given both the label and the edit field the same tag (fm for example). So when you run the command get(handles.fm,'String'), you get the string property of both objects.
K>> get(handles.fm,'String')
ans =
2×1 cell array
{'"0"' }
{'Frequency Modulate(fc)'}
I suggest updating your tags so that no two objects use the same tag.
1 Comment
Image Analyst
on 16 Dec 2020
For robustness, you might assume that if it's a cell array, to get the first (or last) entry:
editFieldContents = handles.fm.String;
if iscell(editFieldContents)
% Extract first string.
editFieldContents = editFieldContents{1}; % or editFieldContents{end}; depending on what you want.
% Put that one string back into the edit field.
handles.fm.String = handles.fm.String;
end
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!