index exceeds matrix dimension

조회 수: 1 (최근 30일)
Haseeb Ahmed Janjua
Haseeb Ahmed Janjua 2017년 9월 27일
댓글: Haseeb Ahmed Janjua 2017년 9월 27일
whenever I create this function in editor
function r = Ymaxfinal(p,q)
r = ((-1000*p*q)/(27*(30*10^6)*0.163*(p+q)))*(p+(2*q))*((3*p(p+(2*q)))^0.5);
end
but when I call it in command window like Ymaxfinal(9,8)
it gives the error of Index exceeds matrix dimensions. plz help me
  댓글 수: 1
Martin Olafsen
Martin Olafsen 2017년 9월 27일
You're missing a multiplication ("*").
r = ((-1000*p*q)/(27*(30*10^6)*0.163*(p+q)))*(p+(2*q))*((3* --->p<---(p+(2*q)))^0.5);
Use this: r = ((-1000*p*q)/(27*(30*10^6)*0.163*(p+q)))*(p+(2*q))*((3*p*(p+(2*q)))^0.5);
Regards

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

채택된 답변

KSSV
KSSV 2017년 9월 27일
Change this line:
r = ((-1000*p*q)/(27*(30*10^6)*0.163*(p+q)))*(p+(2*q))*((3*p(p+(2*q)))^0.5);
to
r = ((-1000*p*q)/(27*(30*10^6)*0.163*(p+q)))*(p+(2*q))*((3*p*(p+(2*q)))^0.5);
  댓글 수: 2
Haseeb Ahmed Janjua
Haseeb Ahmed Janjua 2017년 9월 27일
thanks it works
god bless you
Haseeb Ahmed Janjua
Haseeb Ahmed Janjua 2017년 9월 27일
please check your gmail email id. I need help in Some patterns
will be grateful on your feedback

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by