write data to uitable

6 ビュー (過去 30 日間)
ww ww
ww ww 2017 年 12 月 11 日
コメント済み: Walter Roberson 2017 年 12 月 12 日
the question is : in pushbutton callback i read this code:
C=[h1 h2 h3 h4 h5 h6];
set(handles.uitable1,'DATA',C);
the uitable1 display the result in the first row,
while i will change the value of C, when i push the pushbutton again, how to write C to sceond row?

採用された回答

Walter Roberson
Walter Roberson 2017 年 12 月 11 日
current_data = get(handles.uitable1, 'data');
newdata = [current_data; C];
set(handles.uitable1, 'data', newdata);
  12 件のコメント
ww ww
ww ww 2017 年 12 月 12 日
add an pushbutton~that is ok
Walter Roberson
Walter Roberson 2017 年 12 月 12 日
For this to work the first time, the data property has to have been left initialized to its default [] .
For it to continue to work, the number of columns in C needs to be the same as the number of columns in the existing table.
I suspect some of your calculated h values might be empty, giving you a C shorter than previous rows. Use the debugger to find out.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!