Images Call within For Loop
2 views (last 30 days)
Show older comments
Can you help me out:
Images call within for loop k...k values increasing. Already For loop is running original images call, both folders having a same number of images.This approach working in the initial part of code to call original images.
0 Comments
Accepted Answer
Jan
on 27 May 2017
Edited: Jan
on 27 May 2017
The error message is clear: you try to access the k.th element of manual_images, but this array has less than k elements. This can have many reasons, but they cannot be found in the code snippet you have posted.
Prefer fullfile instead of "[manual_directory, '/*.gif']". I assume the code is working inspite of the wrong file separator, but fullfile would adjust this.
4 Comments
Stephen23
on 27 May 2017
Edited: Stephen23
on 27 May 2017
"I assume the code is working inspite of the wrong file separator"
Actually every single version of Windows API since DOS 2.0 have accepted both \ and / as file path separators (note: as opposed to in the command line): "Contrary to popular belief, the Windows system API accepts slash, and thus all the above Unix examples should work. But many applications on Windows interpret a slash for other purposes or treat it as an invalid character, and thus require you to enter backslash — notably the cmd.exe shell (often called the "terminal" as it typically runs in a terminal window)"
More Answers (1)
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!