why am i getting only the last iteration value?
3 views (last 30 days)
Show older comments
karishma koshy on 25 Jul 2019
Commented: Stephen23 on 29 Jul 2019
i am trying to get how many times each iterations have repeated, which I have got using repmat. But at the end 'FRAM_FINAL' returns only the value of last iterations.
%To read in all images in TIFF-file
ii=output_image3 - meanImage
I2 = mat2gray(ii);
[centreDark1, radiiDark1]=imfindcircles(qq, [Rmin Rmax],'Sensitivity',0.87,'ObjectPolarity','bright');
centreDark = [centreDark;centreDark1];
radiiDark = [ radiiDark;radiiDark1];
Right now the final answer i am getting for the range FR=1:numimgs where numimgs=120
obtained result 120 expected answer: 1
120 so on
so on 120
Samatha Aleti on 29 Jul 2019
In the given code, “FRAM_FINAL” value is updated at every iteration. To make the vector “FRAM_FINAL” hold the results of each iteration, I would suggest concatenating the “FRAM_FINAL” at each iteration with its respective result using cat function.
For more information on concatenation, refer the following link
Stephen23 on 29 Jul 2019
Note that for efficiency the MATLAB documentation recommends preallocating the output array before the loop, and using indexing into the array within the loop:
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!