Code not working?
1 次查看(过去 30 天)
显示 更早的评论
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)
0 个评论
采纳的回答
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)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!