use for loop
1 view (last 30 days)
Show older comments
I want to use "For loop".
Current, I set up a matrix(idx=zeros(1,10);),then the matrix have 10 values.
I want to use the "For Loop" catch the 10 values this is my current code
iii=1;
for iii=1:idx(ik) %iend
iframe(iii)=idx;
iii=iii+1;
for jjj= idx(iii):idx(iii+1)
imshow(uint8(xy(:,:,:,iii)))
end
end
please tell me what is error.
0 Comments
Answers (1)
Wayne King
on 6 May 2012
Please format your code and show your erros. What are you trying to do with your loop, just display slices of your image set?
Why not just:
for iii = 1:10 %or however many slices there are
imshow(uint8(xy(:,:,:,iii)));
pause(0.5);
end
2 Comments
Image Analyst
on 6 May 2012
Well which is it: iii or jjj? Regardless, learn to use the debugger (so you can solve things quickly without waiting on us), set a breakpoint on the imshow() line, and then do this in the command window:
iii
jjj
size(xy)
min(xy(:))
max(xy(:))
Then, if you can't figure out what's wrong, come back here for help.
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!