How to Put Data into table?

조회 수: 1 (최근 30일)
Arun Badigannavar
Arun Badigannavar 2013년 8월 7일
I want to put set of data into a table,,,where my data varies every run,,, First time if I have 3*3 set of data it should display on table,,,again when i run data may be 5*5 ,,,like this every time my data varies,,,how to put data into uitable?

답변 (2개)

David Sanchez
David Sanchez 2013년 8월 7일
From Matlab documentation ( adapt it to your needs ):
f = figure('Position',[200 200 400 150]);
dat = rand(3);
cnames = {'X-Data','Y-Data','Z-Data'};
rnames = {'First','Second','Third'};
t = uitable('Parent',f,'Data',dat,'ColumnName',cnames,...
'RowName',rnames,'Position',[20 20 360 100]);

Suman Saha
Suman Saha 2013년 8월 7일
clear all;clc;close all figure('Name','Di') for i=1:4 prompt =reshape(1:i*i,i,i);
pause(1) t= uitable(); set(t,'Data',prompt) end
  댓글 수: 1
Jan
Jan 2013년 8월 7일
편집: Jan 2013년 8월 7일
I suggest (again) to omit the useless but destructive clear all. There is no benefit, but several drawbacks, e.g. the impeding of the debugger by deleting all breakpoints.
Please compare the optical impression of this unformatted code and the code provided by David.

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

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by