Error: Subscript indices must either be real positive integers or logicals.
Mostrar comentarios más antiguos
Hello, I have attached my code for which I ma getting "Subscript indices must either be real positive integers or logicals" error. I am trying to plot u,v from data file. xi,yi are the centers and trying to plot contours on pad between concentric circles. If anyone would help me with this error I would very much appreciate it.
Thanks
4 comentarios
Image Analyst
el 14 de Nov. de 2015
Attach 'midplane_good_sample3.asc' and let us see what we can do.
avinash desh
el 17 de Nov. de 2015
Walter Roberson
el 17 de Nov. de 2015
Your code uses 1i as a subscript. That is the imaginary value sqrt(-1), also represented as complex(0,1) . That is not a valid subscript for an array.
In order for us to be able to proceed further, you need to describe what you intended those occurrences of 1i to mean
avinash desh
el 19 de Nov. de 2015
Respuestas (1)
James Tursa
el 12 de Nov. de 2015
E.g., in these lines:
x(1i)=1.236;
y(1i)=0.0734;
1i is the imaginary number sqrt(-1) ... it is not a valid value to use for an index. You need to fix this indexing.
4 comentarios
avinash desh
el 12 de Nov. de 2015
Walter Roberson
el 13 de Nov. de 2015
What location in x do you think you are accessing? And why does k not have a value?
It looks to me as if you extracted some code that should be in a for loop but gave it the wrong index names.
avinash desh
el 13 de Nov. de 2015
Walter Roberson
el 14 de Nov. de 2015
No, I am unable to assist people who cannot explain what their code is intended to do.
Categorías
Más información sobre Surface and Mesh Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!