How to avoid overwriting inside a for loop?

5 views (last 30 days)
I'm using repmat inside my for loop. But at the end of the loop, it saves only the value of last iteration repeating that last value alone. How not to overwrite the values of repmat and extract all the values of iterations.
karishma koshy
karishma koshy on 26 Jul 2019
Edited: karishma koshy on 26 Jul 2019
I just want to know to which frame the centre and radius point s detected belongs to. And finally I want to make table.with centre radius and frame number

Sign in to comment.

Answers (1)

Abhilash Padma
Abhilash Padma on 29 Jul 2019
Instead of declaring “frame” as an empty array, declare it as an empty cell array.
And inside for loop, assign the return value of repmat function to “frame{FR}”.Make the following changes in your for loop which may solve your problem.
Now, the cell array “frame stores every value of each iteration.


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!