필터 지우기
필터 지우기

Store values from text file into uitable

조회 수: 3 (최근 30일)
laurie
laurie 2015년 3월 20일
답변: Geoff Hayes 2015년 3월 22일
I created a uitable in GUI and I am trying to get data from a text file to upload into the first column. This is as far as I got.
fid = fopen('file.txt','r'); %open txt file
rawdata = fscanf(fid,'%g',[1 inf]); %store
rawdata=rawdata';
set(handles.uitable1, 'rawdata', Data(:,1)); %store in column 1 of uitable1
Could someone pin point where I'm going wrong?

채택된 답변

Geoff Hayes
Geoff Hayes 2015년 3월 22일
Laurie - you need to set the Data property of the uitable1 with the data. There is no rawdata property that you can access (and so are probably observing some kind of error). Try the following instead
set(handles.uitable1, 'Data', rawdata);
The syntax for set is to supply the handle, then the property name, and then the data that you wish to update the property with. If rawdata is a single column then presumably only the first column (in the table) will be updated.

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