フィルターのクリア

how can I find the maximum value of a parameter running within a loop

2 ビュー (過去 30 日間)
R@SH
R@SH 2021 年 10 月 16 日
コメント済み: R@SH 2021 年 10 月 16 日
Dear All,
I want to extract the maximum of a parameter in aloop through its various ieterations, something like below:
for i=1:100
A=f(i)
B=f(A,i)
C=f(B,i)
end
How can I find the maximum of C and also display corresponding A and B?
I would appreciate your response in advance.

採用された回答

KSSV
KSSV 2021 年 10 月 16 日
maxC = 0 ;
for i=1:100
A=f(i) ;
B=f(A,i) ;
C=f(B,i) ;
if C > maxC
maxC = C ;
Amax = A ;
Bmax = B ;
end
end
[maxC Amax Bmax]

その他の回答 (0 件)

カテゴリ

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

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by