what is the meaning of following code?
1 view (last 30 days)
Show older comments
temp = imread(strcat('output/img', num2str(4*i + j), '.tif'));
0 Comments
Answers (1)
John D'Errico
on 29 Jan 2019
Edited: John D'Errico
on 29 Jan 2019
When you don't understand a line of code, take it apart. Start on the inside most part.
4*i+j : Variables named i and j must exist. 4*i+j does what it looks like, i.e., arithmetic.
num2str(4*i+j): convert that number to a string form
'output/img' : a string
'.tif': Another string
strcat('output/img', num2str(4*i + j), '.tif'): Combine those strings into one string.
Finally, imread does what you think it should do. It reads in an image, with name that was created by the preceding operations.
See Also
Categories
Find more on Image Processing Toolbox 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!