Skip to content

Commit 33c410b

Browse files
committed
Made TableDemo more future-proof
Iterations now use the output of `size` instead of a hard-coded value.
1 parent 4bc6be8 commit 33c410b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Demo/TableDemo.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ function ButtonPushed(app, ~)
1717
w = w(~cellfun(@isempty,w.id) & ...
1818
cellfun(@(x)~isempty(strfind(x,'uniq')),w.id),:); %#ok<STREMP>
1919
% Apply random styles:
20-
for ind1 = 1:4:22
20+
for ind1 = 1:4:size(w,1)
2121
mlapptools.setStyle(...
2222
app.UIFigure,...
2323
'border',...
2424
'2px solid red',...
2525
w{ind1,'id'}{1});
2626
end
2727

28-
for ind2 = 2:4:22
28+
for ind2 = 2:4:size(w,1)
2929
mlapptools.setStyle(...
3030
app.UIFigure,...
3131
'background-image',...
3232
'url(http://lorempixel.com/40/120/)',...
3333
w{ind2,'id'}{1});
3434
end
3535

36-
for ind3 = 3:4:22
36+
for ind3 = 3:4:size(w,1)
3737
mlapptools.setStyle(...
3838
app.UIFigure,...
3939
'background-color',...
@@ -42,7 +42,7 @@ function ButtonPushed(app, ~)
4242
w{ind3,'id'}{1});
4343
end
4444

45-
for ind4 = 4:4:22
45+
for ind4 = 4:4:size(w,1)
4646
mlapptools.setStyle(...
4747
app.UIFigure,...
4848
'padding',...

0 commit comments

Comments
 (0)