Subscript indices must either be real positive integers or logicals.

1 visualización (últimos 30 días)
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.

Respuestas (1)

Youssef  Khmou
Youssef Khmou el 13 de Mayo de 2013
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')

Categorías

Más información sobre Stress and Strain en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by