필터 지우기
필터 지우기

Load File in GUI GUIDE to Read 2 Columns

조회 수: 1 (최근 30일)
Amanda
Amanda 2012년 9월 1일
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
  댓글 수: 1
Amanda
Amanda 2012년 9월 1일
I don't know how I missed it. Thanks.

댓글을 달려면 로그인하십시오.

추가 답변 (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