uitable operation

1 view (last 30 days)
yue ishida
yue ishida on 2 Nov 2011
I want to perform the uitable operation as below:
1. Row first has 15 empty cells, row second has 15 empty cells and row three has 15 empty cells too.
2. In row 1st, I put a number in cell 1 and cell 6. In row 2nd, I put a number in cell 7. In row 3 still empty.
3. In row 1st, 2nd and 3rd, I need to put number 0 automaticly accept the filled cells before.
How this operation will code? I want to know the steps because really do not know how. Please help me.

Accepted Answer

Walter Roberson
Walter Roberson on 2 Nov 2011
data = cell(3,15);
data{1,1} = rand; data{1,6} = rand;
data{2,7} = rand;
data(cellfun(@isempty,data)) = 0;
uitable(..., 'Data', 'data');

More Answers (1)

yue ishida
yue ishida on 2 Nov 2011
thanks, the code is very helpful.

Community Treasure Hunt

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

Start Hunting!