from what i see get snapshot returns a NxMx(1 for mono 3 for color) and you're trying to stuff it into a 1x1. what you should try is i=1 for start as data(0) isn't how matlab works. and put data as data(:,:,i) for monochrome as you'll be putting a NxM into data's NxMx1 indexes. change the data() into a cell array if you want to store it as an rgb image.
1 Comment
Jan (view profile)
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/333609-save-snapshot-image-in-a-variable-within-a-loop#comment_443066
Sign in to comment.