Effacer les filtres
Effacer les filtres

Load File in GUI GUIDE to Read 2 Columns

1 vue (au cours des 30 derniers jours)
Amanda
Amanda le 1 Sep 2012
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

Réponse acceptée

Walter Roberson
Walter Roberson le 1 Sep 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
  1 commentaire
Amanda
Amanda le 1 Sep 2012
I don't know how I missed it. Thanks.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by