# How can I insert a detail in the peak of the curve ?

13 vues (au cours des 30 derniers jours)
Mallouli Marwa le 28 Août 2020
Commenté : Star Strider le 30 Août 2020
Hi
How can I insert a detail in the peak of the curve like the attached curve ?
omega = 125.6:0.1:502.4;
freq = 2*pi*omega;
figure (1)
plot (freq,V_86,'g', freq,V_89,'k', freq,V_91,'m',freq,V_92,'c',freq,V_95,'b','LineWidth',2);
legend('FVF = 0.86','FVF = 0.89','FVF = 0.91','FVF = 0.92','FVF = 0.95');
xlabel ('Frequency [Hz]');
ylabel('|Voltage FRF| [V/g]');
##### 1 commentaireAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens
Star Strider le 30 Août 2020

Connectez-vous pour commenter.

### Réponses (2)

Serhii Tetora le 28 Août 2020
use function axes for zommed peak. you can define those Position and Limits.
and annotation('arrow') for arrow.
##### 1 commentaireAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens
Mallouli Marwa le 28 Août 2020

Connectez-vous pour commenter.

Star Strider le 28 Août 2020
Experiment with this:
f = @(w,c) 1./(w.^2 + 10*w - c+50);
w = linspace(20,80,250);
c = (0.1:0.2:0.9).';
figure
ax1 = axes('Position',[0.2 0.1 0.7 0.8]);
ax2 = axes('Position',[0.25 0.65 0.15 0.2]);
plot(ax1, w, f(w-50,c))
Lv = (w>=43) & (w<=47);
plot(ax2, w(Lv), f(w(Lv)-50,c))
ax2.XTickLabel = [];
ax2.YTickLabel = [];
annotation('arrow',[0.37 0.48], [0.8 0.8])
producing:
This should get you started. You can use this code with your own data and adjust it to present the plot you want. (You will have to experiment with it.)
See the documentation on axes and annotation for details.
##### 2 commentairesAfficher AucuneMasquer Aucune
Mallouli Marwa le 28 Août 2020
I have obtained this error below.
Error using -
Matrix dimensions must agree.
Error in Plot_detail>@(w,c)1./(w.^2+10*w-c+50)
Error in Plot_detail (line 9)
plot(ax1, w, f(w-50,c))
Star Strider le 28 Août 2020
My code runs for me without error (in R2020a). I cannot reproduce the error you reported.
You need to adapt my code to your data and curves. I am simply making it easier for you, so all you need to do is to adapt your vectors to use my code.

Connectez-vous pour commenter.

### Catégories

En savoir plus sur Annotations dans Help Center et File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by