how to pass data to a Table in GUI?
2 ビュー (過去 30 日間)
古いコメントを表示
I have a GUI with one input (x) and it returns one numeric output (Y) and matrix (Tab) in a table. The problem is the generated table in the GUI is not updated with every new input (x). Any hints what is the wrong in the code? Note that in the GUI I am defining a table with 5*5 (5 rows and 5 columns)
I used the following code:
x = str2double(get(handles.input1, 'String'));
[Y, Tab]= SyX(x);
set(handles.output1, 'String', Y);
set(handles.TabOutput, 'data', Tab);
function [Y, Tab]= SyX(x)
Y = x+2;
if x==1
Tab=[1 2 0 1]
elseif x==2
Tab = [1 0];
elseif x==3
Tab = [1 2;3 4];
else
Tab = [1 0 0;0 1 0; 0 0 1]
end
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Tables についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!