フィルターのクリア

How to display a matrix in a matlab GUI table.

14 ビュー (過去 30 日間)
Declan Simons
Declan Simons 2015 年 3 月 30 日
回答済み: Image Analyst 2015 年 3 月 30 日
I have made a matrix and a table in the GUI but am unsure how to load the data into.
The data in question is called comparison just for example.
I have written the data as a 4x4 matrix.

回答 (2 件)

Jan
Jan 2015 年 3 月 30 日
編集済み: Jan 2015 年 3 月 30 日
The documentation of uitable explains clearly how to insert data. Do you have a specific question after reading the docs?
f = figure;
t = uitable('ColumnName', {'a', 'b', 'c', 'd'});
drawnow;
set(t, 'Data', rand(4))
  1 件のコメント
Declan Simons
Declan Simons 2015 年 3 月 30 日
編集済み: Declan Simons 2015 年 3 月 30 日
That was the original template I used.
function uitable5_CellSelectionCallback(hObject, eventdata, handles) table = uitable(comparison,'Comparisons')
This is what I want to display.
comparison =
1.0000 2.0000 3.0000 4.0000
0.5000 1.0000 5.0000 1.0000
0.3333 0.2000 1.0000 8.0000
0.2500 1.0000 0.1250 1.0000
I already have the table set in the GUI with the correct dimensions. Just unsure how I can make it display the matrix desired.

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


Image Analyst
Image Analyst 2015 年 3 月 30 日
Whenever you want to send new data in "comparison" to your table, do this:
set(handles.uitable1, 'Data', comparison);
uitable1 is whatever you have as the "tag" property for your table in GUIDE.

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by