How to save fvtool diagram as a matlab figure??

8 vues (au cours des 30 derniers jours)
Brasco , D.
Brasco , D. le 30 Oct 2014
Commenté : Craig le 9 Déc 2019
Hi guys,
I am new with this staff and have a problem about saving fvtool Magnitude Response plot as matlab figure.
You can export it as image formats(.jpeg, .png,.. ) but not in ".fig"
Anyone can help me?
Here is simple fvtool code;
filter_4_t =[0.2018 0.1189 0.1793 0.1793 0.1189 0.2018];
filter_5_t =[0.1716 0.1300 0.1984 0.1984 0.1300 0.1716];
filter_4_c =[0.2260 0.0772 0.1968 0.1968 0.0772 0.2260];
filter_5_c =[0.1921 0.0960 0.2119 0.2119 0.0960 0.1921];
bode=fvtool(filter_4_t,1,filter_5_t,1,filter_4_c,1,filter_5_c,1,'Fs',50);
legend(bode,'Taylor4','Taylor5','Chebyshev4','Chebyshev5');
I want to save the bode diagram as a figure.
Is there any way to do it?

Réponse acceptée

Brasco , D.
Brasco , D. le 30 Oct 2014
Modifié(e) : Brasco , D. le 30 Oct 2014
I found an answer for my problem. it is abit long way but works for me.
I get the axis data of the figure object and redraw it as a matlab figure.
hfvt = fvtool(filterobj);
s = get(hfvt);
hchildren = s.Children;
haxes = hchildren(strcmpi(get(hchildren,'type'),'axes'));
hline = get(haxes,'children');
x = get(hline,'XData');
y = get(hline,'YData');
after this i can "plot (x,y)" and do whatever i can.
  1 commentaire
Craig
Craig le 9 Déc 2019
Thank you for taking the time to follow up and post your own answer, I found it useful.

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by