Info

This question is closed. Reopen it to edit or answer.

Can I set up several datas in one table, in GUI ?

1 view (last 30 days)
pty0220
pty0220 on 22 Mar 2016
Closed: MATLAB Answer Bot on 20 Aug 2021
Can I set up several datas in one table, in GUI ?
for example, a = [1,2,3] b = [4,5,6] c = [7,8,9]
in GUI table show
  • 1 2 3
  • 4 5 6
  • 7 8 9
another example
I want to write code like this
set(handles.uitable1(1,:) , 'data', a)
set(handles.uitable1(2,:) , 'data', a)
set(handles.uitable1(3,:) , 'data', a)
How can I do that ?? Is it impossible ?? if it is possible , Plz tell me right code

Answers (1)

Jan
Jan on 22 Mar 2016
Edited: Jan on 22 Mar 2016
a = [1,2,3];
b = [4,5,6];
c = [7,8,9];
data = cat(1, a, b, c);
set(handles.uitable1, 'Data', data);
"set(handles.uitable1(1,:) , 'data', a)" is not meaningful, because it is no valid Matlab syntax (except if you have an array of uitables). So please explain what you want this command to do. Note, that we cannot guess the purpose of invalid code.
  3 Comments
Jan
Jan on 23 Mar 2016
A table is rectangular. What do you want to appear in the 'empty' elements? Should the data appear as vectors in the table?
Please describe exactly, what you want to achieve.

Community Treasure Hunt

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

Start Hunting!