Azzera filtri
Azzera filtri

Load File in GUI GUIDE to Read 2 Columns

1 visualizzazione (ultimi 30 giorni)
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

Risposta accettata

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

Più risposte (0)

Categorie

Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by