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

 Réponse acceptée

Geoff Hayes
Geoff Hayes le 5 Nov 2017

0 votes

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 commentaires

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 le 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 le 5 Nov 2017
Thank you so much, it worked !

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Mathematics and Optimization dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by