selecting values between vectors and plot the values
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi,
I have 4 vectors which are unsorted. All have all same length of 360:
Ax, Bx - Values are real numbes between 0 to 360. Values are increasing / decreasing and with modulu 360.
Ay,By - corrolated to Ax, Bx. real numbes between 0 to 180.
(Best was to describe thos vectors are as single sine with phase shift and/or reversal (i.e. -sin(x) )).
I need to:
- find max between Ay, By at given point of x vectors.
- plot the max value with appropriate value from Ax or Bx.
What I've though is:
- sort Ax, Bx and to find the original order (sorting will provide me the initial value which is close to 0.
- based on the indexes of the sorting, find Y=max (Ay(idx_a), By(idx_b))
- running in for loop in order to find whether the Y(i) is related to Ay to or By and set X from Ax or Bx.
- plot(X,Y)
I think that this is not so elegant solution.
Would be glad to have a proposal for a more elegant one.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Dates and Time에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!