Subscript indices must either be real positive integers or logicals.
1 回表示 (過去 30 日間)
古いコメントを表示
Hello everybody! I am making a program in order to plot the velocity profile (of a fluid), with respect to its maximum shear stress, so I want to plot the velocity (U) in the columns where it's reached that maximum, the code is the following:
position=max(TAU); plot(r,U(position,:),'b')
where TAU and U are both matrices with dimensions equal to = 12045x50 and r is a dimensionless number which has dimension=50x1
and I obtained the following error: Subscript indices must either be real positive integers or logicals.
Which should I do?
Thanks.
0 件のコメント
回答 (1 件)
Youssef Khmou
2013 年 5 月 13 日
hi Isabel
You obtained that error because the variable position corresponds to the Numberical maximums not the Index or 'position' as you mean , try this :
[Values,Position]=max(TAU);
plot(r,U(position,:),'b')
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Stress and Strain についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!