Error: Subscript indices must either be real positive integers or logicals.
Show older comments
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 Comments
Image Analyst
on 14 Nov 2015
Attach 'midplane_good_sample3.asc' and let us see what we can do.
avinash desh
on 17 Nov 2015
Walter Roberson
on 17 Nov 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
on 19 Nov 2015
Answers (1)
James Tursa
on 12 Nov 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 Comments
avinash desh
on 12 Nov 2015
Walter Roberson
on 13 Nov 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
on 13 Nov 2015
Walter Roberson
on 14 Nov 2015
No, I am unable to assist people who cannot explain what their code is intended to do.
Categories
Find more on Contour Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!