use a loop to iterate through the number of columns in a matrix/array
1 view (last 30 days)
Show older comments
I combine two images together by doing this -
imshow([image1(:,1:125,: ) image2(:,126:end,: )]);
Now I want to make a loop that will iterate over all the column indices of my matrix.
0 Comments
Answers (2)
Walter Roberson
on 18 Jul 2015
newimage = [image1(:,1:125,: ), image2(:,126:end,: )];
for K = 1 : size(newimage,2)
thiscolumn = newimage(:,K,:);
do something with the data
end
0 Comments
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!