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

 Risposta accettata

Geoff Hayes
Geoff Hayes il 5 Nov 2017
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 Commenti

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
Geoff Hayes
Geoff Hayes il 5 Nov 2017
Nadine - are you using the Symbolic Toolbox to calculate S and Ie? If so, try converting them to doubles using double.
Nadine
Nadine il 5 Nov 2017
Thank you so much, it worked !

Accedi per commentare.

Più risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by