Finding specific iteration in a triple for loop

조회 수: 1 (최근 30일)
Jacky Foo
Jacky Foo 2020년 5월 29일
댓글: Jacky Foo 2020년 5월 31일
I am trying to find the corresponding values of alpha, beta and gamma where my P value is maximum. My code is able to get maximum value of P = 1.9956 but I have no idea how to get the corresponding values of alpha, beta and gamma.
I have attached the question and my current code.
Could anyone help me out. Much appreciated.

채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2020년 5월 29일
편집: KALYAN ACHARJYA 2020년 5월 29일
You can't do that, as all having different lengths. For equaly vector sie you can get the undex position and find the corresponding vector elements from a,b and y. To compare the corresponding array elements, arrays sizes must be same.
>> length(a)
ans =
151
>> length(b)
ans =
126
>> length(y)
ans =
21
>> length(P)
ans =
399546
I suspect, there may be issue within loop. Look for the solution, how to generate the same length size P, so that you can find the respective array elements from a,b and y, those index values generate the max P.
  댓글 수: 1
Jacky Foo
Jacky Foo 2020년 5월 31일
Yeah, there was an issue in the for loop. I got it fixed. Thanks for your help!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by