How to find the x and y coordinates of the maximum value in curve without defferntiaition
Mostra commenti meno recenti
Hi I have a curve,I want to find x and y coordinate of the maximum value Thanks
1 Commento
James Tursa
il 4 Giu 2015
In what form do you have the curve? A one line definition? A function file? Or what?
Risposta accettata
Più risposte (1)
yousef Yousef
il 5 Giu 2015
Modificato: yousef Yousef
il 5 Giu 2015
0 voti
7 Commenti
Alfonso Nieto-Castanon
il 5 Giu 2015
that looks fine, remove the round operation or better yet use ImageAnalyst solution above (replacing y with abs(P) and x with THETA)
yousef Yousef
il 5 Giu 2015
Alfonso Nieto-Castanon
il 5 Giu 2015
from your code and from your graph, theta is defined from -90 to 90, so it is hard to imagine how you could get -180 as theta(indexOfMaxY), could you please clarify?
yousef Yousef
il 5 Giu 2015
Alfonso Nieto-Castanon
il 5 Giu 2015
Modificato: Alfonso Nieto-Castanon
il 5 Giu 2015
Could you copy and paste the following code and report the result figure and values displayed in the command window?
figure;
plot(theta,Pmusic);
[maxP,maxIdx]=max(Pmusic);
fprintf('Maximum value %f at theta=%f\n',maxP,theta(maxIdx));
yousef Yousef
il 5 Giu 2015
Alfonso Nieto-Castanon
il 5 Giu 2015
great, if that works please accept ImageAnalyst solution above since this was basically his original suggestion
Categorie
Scopri di più su Graphics Performance in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

