Edit box string to column value plotting
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Greg Morris
am 19 Jun. 2019
Bearbeitet: Stephen23
am 19 Jun. 2019
Im attempting to use edit boxes in a GUI as away to destinguish what columns a plot command recognizes as a plot
numdata=xlsread(uigetfile({'.xlsx'},'File Selector'));
x=numdata(:,str2num(handles.XCInput, 'string'));
y=numdata(:,str2num(handles.YCInput, 'string'));
plot (x,y)
XCInput and YCInput are the tags for the chosen text edits
Akzeptierte Antwort
Stephen23
am 19 Jun. 2019
Bearbeitet: Stephen23
am 19 Jun. 2019
You invented a str2num syntax that does not exist:
str2num(handles.YCInput, 'string')
% ^^^^^^^^^^ is this in the STR2NUM documentation?
Where in the STR2NUM documentation is the 2nd input shown? (hint: nowhere, it does not exist).
If you want to use functions, you need to follow the syntaxes that they actually support:
x = numdata(:,str2num(handles.XCInput));
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Annotations finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!