필터 지우기
필터 지우기

How to find the location of a value in a array?

조회 수: 1 (최근 30일)
Avi
Avi 2018년 6월 4일
댓글: Jan 2018년 6월 5일
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
Avi
Avi 2018년 6월 4일
Actually I found a problem with the values. I will solve it first and get back. Thanks for the help.
But the condition that i was talking about was,
The condition is to find the location in each row of y and z , the values less then and greater then each corresponding value of pyy and pzz. Consider the value pyy(1) = 0. Now, we have to locate the two values in y(1,61) those are in the proximity of 0, which occurs twice at columns 16 & 17 and 46 & 47.
similarly, when we find the two set of values in proximity of pzz = -138.5. There will be two sets of values.
Then, from the two set of values for y and z, one set is same for both, here 46 and 47th.
Jan
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 CenterFile Exchange에서 Engines & Motors에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by