How would I find the value of a corresponding data set?
조회 수: 3 (최근 30일)
이전 댓글 표시
Say that I have
x=[1;2;5;4;3]
y=[2018;2019;2020;2021;2022]
I know that
[value, index] = max(x) will return
value=5
index=3
But now I want to print the corresponding value of "y" given the index 3. How would I do that using just the variables?
댓글 수: 0
답변 (1개)
the cyclist
2020년 1월 27일
When you say "corresponding", do you mean the 5th
y(value)
or the 3rd?
y(index)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!