Code not working?

조회 수: 7 (최근 30일)
Catherine Mohs
Catherine Mohs 2019년 1월 31일
댓글: Catherine Mohs 2019년 1월 31일
I keep getting an error when I run this code. What am I doing wrong?
t=[0:2:100];
height=2.13*t.^2-0.0013*t.^4+0.000034*t.^4.751;
max_height=max(height)
time_max_height=t(max_height)

채택된 답변

madhan ravi
madhan ravi 2019년 1월 31일
[max_height,idx]=max(height);
% ^^^---- gives the index , you were rying to index with value instead of true index
time_max_height=t(idx)
  댓글 수: 1
Catherine Mohs
Catherine Mohs 2019년 1월 31일
Thank you!

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

추가 답변 (0개)

카테고리

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

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by