I am unable to store values for every iteration, values are overwritten in each iteration.
古いコメントを表示
how can i get all the values for frame. it is showing only the last value of numimgs ie., 1000. it is being overwritten. i tried using fr(:)=frame(:). but then it show error 'Unable to perform assignment because the left and right sides have a different number of elements'.
thanking in advance for help.
回答 (1 件)
infinity
2019 年 7 月 25 日
Hello,
Try this
fr{Fr} = frame(:);
5 件のコメント
Stephen23
2019 年 7 月 25 日
With preallocation the code will be less liable to bugs:
N = 25;
C = cell(1,N);
for k = 1:N
...
C{k} = ...
end
karishma koshy
2019 年 7 月 25 日
Hello,
You create matrix "frame" by using repmat function. So, you will get "frame" as repeated matrix of FR in the horizontal direction with "length(centreDark(:,1))" times. Then, you store it into "fr". Now, What do you expect to have in "fr"?
karishma koshy
2019 年 7 月 25 日
編集済み: karishma koshy
2019 年 7 月 25 日
infinity
2019 年 7 月 25 日
Hello,
Since you have stored values of frame into "fr". Now, you want to show it like column vector ("fr"), you could simply change type of it by
obtained_result = cell2mat(fr)'
カテゴリ
ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!