How to find the location of a value in a array?
2 次查看(过去 30 天)
显示 更早的评论
I have four sets of values y(211*61), z(211*61), pyy(1*211), pzz(1*211). Please refer the attached excel file. I have to locate for every value in pyy and pzz two values(one greater than and one less than y and z respectively) for every row of y and z.
For the location, values both in y and z must satisfy the condition. Now, consider the first value in pyy is 0 and in pzz is -138.5. then, for the corresponding values, I get the location in 1st row of y and z as 46 and 47th column number.
In every y and z row the condition is satisfied twice,but it is satisfied together only at one location as can be seen from the example above.
Any help would be appreciated. Thanks in advance.
3 个评论
Jan
2018-6-5
Is your problem solved? If not, I have to admit, that I do not understand the explanation:
- Values cannot be "less then and greater then". Do you mean: "not equal"?
- "the two values in y(1,61)" - y(1, 61) is a scalar, such that it cannot contain 2 values.
- What does "in the proximity of 0" mean?
- "from the two set of values for y and z, one set is same for both, here 46 and 47th." - I have no clue, what this means.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dijkstra algorithm 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!