フィルターのクリア

How to do: "for each value of the vector A"

60 ビュー (過去 30 日間)
AlexDp
AlexDp 2019 年 9 月 14 日
コメント済み: Robin Amar 2021 年 12 月 23 日
Hi all,
i'd like to know how is possible to get the iteration for each element of a vector. I show an example.
A=[14 5 7 3 8];
for i=each element of A
etc
end
Thanks to all will answer me.

回答 (1 件)

madhan ravi
madhan ravi 2019 年 9 月 14 日
for ii = 1:numel(A) % this is for illustration purposes
A(ii)
end
  4 件のコメント
Stephen23
Stephen23 2019 年 9 月 15 日
Note that in most real-world code, looping over indices (as per madhan ravi's original answer), is much more useful.
Robin Amar
Robin Amar 2021 年 12 月 23 日
Thanks for the 2nd Suggestion @madhan ravi. I wanted precisely this answer.
This operation is straight forward in Python as well.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSubplots についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by