a loop consist on images how to get some specific data from this loop

for i=1:300
s = strcat('C:\Users\shake\OneDrive\Desktop\ab\',int2str(i));
load(s)
pause(0.5)
imshow(cjdata.image,[]),title(int2str(i))
end
from above data set 1:300 we want to get specific data for example a=1:8 b=10:15 c=20:23
so on we want to devide the loop in to specific blocks

Answers (1)

for i=1:300
s = strcat('C:\Users\shake\OneDrive\Desktop\ab\',int2str(i));
end
% First block
for a = 1:8
load(s{a}) ;
end
% some block
for c = 20:23
load(s{c}) ;
end

1 Comment

for i=2:15
s = strcat('C:\Users\shake\OneDrive\Desktop\ab\',int2str(i));
end
for a = 2:6
load(s{a}) ;
end
for c = 7:9
load(s{c}) ;
end
for b = 10:15
load(s{b}) ;
end
load(s)
pause(0.5)
imshow(cjdata.image,[]),title(int2str(i))
give error in this line load(s{a}) ;

Sign in to comment.

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Asked:

on 7 Feb 2022

Commented:

on 7 Feb 2022

Community Treasure Hunt

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

Start Hunting!