Error using data in uitable

Hi, I want to create a uitable using data from a function,this is the code :
t = uitable('Data',[S Ie E] ,'ColumnName',{'Integrale' 'Y' 'R'})
But this error keeps showing : While setting the 'Data' property of Table: Data must be a numeric, logical, or cell array
S,Ie and E are already calculated
Please help me

 Accepted Answer

Nadine - what are the data types for S, Ie, and E? Please show how they are calculated. I observe the same error if one of these variables is a string.
S = 1;
Ie = 2;
E = '3';
t = uitable('Data',[S Ie E] ,'ColumnName',{'Integrale' 'Y' 'R'})
So I suspect that the same is true for one or more of your three variables. As the error message indicates, these variables must be numeric, logical, or a cell array.

3 Comments

Nadine's answer moved here
I want to put my function outputs in a table.
My script is like this
% function that calculates Ie S E
Ie = ..
S = ..
E = ..
t = uitable('Data',[S Ie E] ,'ColumnName',{'Integrale' 'Y' 'R'})
end
For example i got:
S =
49/2
Ie =
45/2
E =
2
the results are numerical but its like uitable doesnt replace the values
Nadine - are you using the Symbolic Toolbox to calculate S and Ie? If so, try converting them to doubles using double.
Thank you so much, it worked !

Sign in to comment.

More Answers (0)

Tags

Asked:

on 5 Nov 2017

Commented:

on 5 Nov 2017

Community Treasure Hunt

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

Start Hunting!