Generate a table in Matlab GUI (matlab 7.0.1)
이전 댓글 표시
Hi all,
I have an excel sheet containing 30 rows and 30 columns. Using Matlab Guide, I read the excel sheet. Now I want to display the contents of the excel sheet as a table (figure) containing 30 rows and 30 columns.
I tried with uitable.
p1 = xlsread('C:\Documents and Settings\user\Desktop\sample.xls','Sheet1'); f = figure('Position',[100 100 752 350]); t = uitable('Parent',f,'Position', [ 25 25 700 200]); set(t, 'Data', p1)
On executing the above code, I get the following error: ??? Invalid handle object.
What am I supposed to do???
I am using Matlab 7.0.1.
Thanks in advance for the help.
답변 (2개)
ES
2013년 9월 18일
Insert a uitable in your GUI by name say TableDemo. then read data from xls like you have done,
p1 = xlsread('C:\Documents and Settings\user\Desktop\sample.xls','Sheet1');
and
set(handles.TableDemo,'Data',p1);
Jan
2013년 9월 19일
handles.tabledemo = uitable('Position', [ 25 25 700 200]);
set(handles.tabledemo,'Data',p1);
guidata(f, handles); % Store handles in the ApplicationData of f for later use
카테고리
도움말 센터 및 File Exchange에서 App Building에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!