Generate a table in Matlab GUI (matlab 7.0.1)
Show older comments
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.
1 Comment
Subhiksha
on 19 Sep 2013
Answers (2)
ES
on 18 Sep 2013
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
on 19 Sep 2013
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
Categories
Find more on App Building in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!