Error: Subscript indices must either be real positive integers or logicals.

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

Attach 'midplane_good_sample3.asc' and let us see what we can do.
Hello, The asc file is huge(12mb), could you recommend a way I can send you the file
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
Hello Walter, I have attached code with explanation of x(I) and y(I). I think I was able to get the contours on the surface for what I wanted. Figures 1 and 2 in code will show you the part and surface on which I need contours. I have another question. How do I delete all the points such that I can see only contours on the blue surface in Z direction. I only need contours in Z direction. Any help would be much appreciated.

Sign in to comment.

Answers (1)

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

Thank you for reply, how do I fix the indexing. Could you please advise.
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.
Hello Walter, Is there anyway you could help me with correcting this code
No, I am unable to assist people who cannot explain what their code is intended to do.

Sign in to comment.

Categories

Asked:

on 12 Nov 2015

Commented:

on 19 Nov 2015

Community Treasure Hunt

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

Start Hunting!