Prev: Simbiology memory hog
Next: Problem with code
From: KrloX on 21 May 2010 15:48 I have this code on matlab: for k = 1 : amount TAMA=measures(k).Area; if TAMA > 1000 thismeasure = measures(k).BoundingBox; subImage = imcrop(Image, thismeasure); if TAMA>1000 j=j+1; subplot(3, 4, j); imshow(subImage); end caption = sprintf('Element #%d\nDiameter = %.1f pixels\nArea = %d pixels', k, blobECD(k), measures(k).Area); title(caption, 'FontSize', 14); end end The thing is, where i have "subImage", i want that for each loop, each sub-image gets stored in a different matrix instead of replacing everytime the same, like subImage1, subImage2, subImage3, untill it gets to subImage[amount]. is it possible? thanks in advance
From: Steven Lord on 21 May 2010 21:05 "KrloX" <charlyjr26(a)hotmail.com> wrote in message news:1851685697.204521.1274485740023.JavaMail.root(a)gallium.mathforum.org... >I have this code on matlab: > for k = 1 : amount > TAMA=measures(k).Area; > if TAMA > 1000 > thismeasure = measures(k).BoundingBox; > subImage = imcrop(Image, thismeasure); > if TAMA>1000 > j=j+1; > subplot(3, 4, j); > imshow(subImage); > end > caption = sprintf('Element #%d\nDiameter = %.1f pixels\nArea = %d pixels', > k, blobECD(k), measures(k).Area); > title(caption, 'FontSize', 14); > end > end > > The thing is, where i have "subImage", i want that for each loop, each > sub-image gets stored in a different matrix instead of replacing everytime > the same, like subImage1, subImage2, subImage3, untill it gets to > subImage[amount]. > is it possible? Yes, it is possible. However, you should NOT do this. See Q4.6 in the newsgroup FAQ for some of the reasons why. Use an N-D array or a cell array instead. -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ To contact Technical Support use the Contact Us link on http://www.mathworks.com
|
Pages: 1 Prev: Simbiology memory hog Next: Problem with code |