フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

could anyone help me to fix the issue.

2 ビュー (過去 30 日間)
Prabha Kumaresan
Prabha Kumaresan 2018 年 4 月 13 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I am running the o_th with respect to 4 iterations and i am getting the result as follows.
iteration-1
o_th(:,:,1) = [1.6910e+08]
o_th(:,:,2) =[1.8615e+08]
iteration-2
o_th(:,:,1) =[1.3947e+08]
o_th(:,:,2) =[2.6361e+08]
iteration-3
o_th(:,:,1) = [1.3913e+08]
o_th(:,:,2) = [1.2937e+08]
iteration-4
o_th(:,:,1) =[1.7136e+08]
o_th(:,:,2) = [1.1630e+08]
I want to calculate the maximum value among the 4 iterations and i used the command
iwant=max(cell2mat(o_th(:,:,:))).
But it considers only the last iteration and gives the maximum value.But i want to have the maximum among the 4 iterations.Could anyone tell me how to fix the issue.
  1 件のコメント
KSSV
KSSV 2018 年 4 月 13 日
YOu should not store the values like that...you have to store values at every iteration. On the same concept you asked four questions so far. They have been answered and you are repeating the same question. I advice you to go through basics of MATLAB first.

回答 (1 件)

Torsten
Torsten 2018 年 4 月 13 日
編集済み: Torsten 2018 年 4 月 13 日
iwant = -Inf; % Initialization of iwant
iwant = max(iwant,cell2mat(o_th(:))); % update of iwant in iteration loop
Best wishes
Torsten.

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by