Count numbers from 0 to a value input by the user in uitable
1 回表示 (過去 30 日間)
古いコメントを表示
採用された回答
Jan
2017 年 10 月 16 日
n = input('Number of rows: ');
Data = cell(n+1, 3);
Data(:,1) = num2cell((0:n).');
f = figure;
t = uitable(f);
t.ColumnName = {'User Input', 'Capacity Available', 'Probability'};
t.ColumnEditable = [false, true, true];
t.Data = Data;
0 件のコメント
その他の回答 (1 件)
Walter Roberson
2017 年 10 月 16 日
uitable, use a Data cell array with three columns, and configure the column names and column types.
2 件のコメント
Walter Roberson
2017 年 10 月 16 日
There are a number of ways to put data into a cell array, including a plain "for" loop.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!