How would I find the value of a corresponding data set?

2 visualizaciones (últimos 30 días)
Aadi Duggal
Aadi Duggal el 27 de En. de 2020
Respondida: the cyclist el 27 de En. de 2020
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?

Respuestas (1)

the cyclist
the cyclist el 27 de En. de 2020
When you say "corresponding", do you mean the 5th
y(value)
or the 3rd?
y(index)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by