フィルターのクリア

Am i correct with my conversion of a Logical indexing to a for loop?

2 ビュー (過去 30 日間)
Zachary Holmes
Zachary Holmes 2015 年 12 月 2 日
回答済み: Thorsten 2015 年 12 月 2 日
Logical indexing is:
T ( T > 10) = 10;
My Loop is:
for (T>10)
T = 10?
Also how could i do a while loop?
thanks

回答 (2 件)

Walter Roberson
Walter Roberson 2015 年 12 月 2 日
Your loop variable should be over all the valid indices of the array, and inside the loop you should have a test that decides what to do.
Once you understand while loops from your other questions you should be able to do the conversion for this question as well.

Thorsten
Thorsten 2015 年 12 月 2 日
for i = find(T > 10)
T(i) = 10;
end

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by