Load File in GUI GUIDE to Read 2 Columns

1 次查看(过去 30 天)
I've been at this for 3 hours -- so I need help.
I have a push button on the GUI GUIDE to load a text file to store 2
columns of data as x and y. So x = 12,12,23.
textfile A is:
12 23
12 32
23 32
The code that is in the GUI GUIDE under the pushbutton load_file is:
filename = uigetfile('*.txt')
loaddata = fullfile(pathname,filename)
load(loaddata)
A = filename(:,1)
B = filename(:,2)
handles.input1 = A;
handles.input2 = B'
axes(handles.axes1)
plot(handles.input1,handles,imput2)
Thanks, Amanda

采纳的回答

Walter Roberson
Walter Roberson 2012-9-1
AB = load(loaddata);
A = AB(:,1);
B = AB(:,2);
Also, you will probably want to
guidata(gcf, handles);
after you assign to handles.input2

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by