Clear Filters
Clear Filters

How do I find the associated x index for a max y value?

14 views (last 30 days)
I'm working with a graph that compares load resistance values against power supplied, and I have the max y-value, but I need to find the corresponding x index so I can mark the high point of the graph.
Identifies the max y value: [P_max, index] = max(P); Need to find the corresponding x index so I can plot the max point: [???????] = ???(?) ?

Accepted Answer

KSSV
KSSV on 4 Apr 2018
[P_max, index] = max(P)
iwant = yourvariable(index)

More Answers (0)

Categories

Find more on Data Type Identification in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!