finding the max number?
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
x=[1 3 5 7]
y=x^2+5
y=[6 14 30 54]
max(y)
how do i find x value corresponding to max(y)?
0 comentarios
Respuestas (1)
Chunru
el 12 de Sept. de 2021
x=[1 3 5 7]
y=x.^2+5 % use .^ here
[~, idx] = max(y) % idx the where y is the max
x(idx) % corresponding x
y(idx)
0 comentarios
Ver también
Categorías
Más información sobre Structures en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!