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!