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

 采纳的回答

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 个评论

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 !

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Workspace Variables and MAT Files 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by