リアルタイムに変化する変数への代入値を記録する方法
显示 更早的评论
こんにちは。
以下のコードについて質問があります。
for object = 1:length(stats)
bb = stats(object).BoundingBox;
bc = stats(object).Centroid;
plot(bc(1),bc(2), '-m+')
a=text(bc(1)+15,bc(2), strcat('X: ', num2str(round(bc(1))), ' Y: ', num2str(round(bc(2)))));
set(a, 'FontName', 'Arial', 'FontWeight', 'bold', 'FontSize', 14, 'Color', 'white');
end
ある条件下ではこのfor文が実行され、このfor文中の変数bcはリアルタイムに変化します。 この変化するbcの数値をすべて記録したいのですが、よい記述方法が思いつきません。 インクリメントのobjectは、必ずしも1ずつ増加するという動作を実行しておらず、 そのことが処理を難しくしています。
なんとかこのbcを記録する方法はないでしょうか。 回答をよろしくお願いします。
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!