Azzera filtri
Azzera filtri

How to save fvtool diagram as a matlab figure??

14 visualizzazioni (ultimi 30 giorni)
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?

Risposta accettata

Brasco , D.
Brasco , D. il 30 Ott 2014
Modificato: Brasco , D. il 30 Ott 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 Commento
Craig
Craig il 9 Dic 2019
Thank you for taking the time to follow up and post your own answer, I found it useful.

Accedi per commentare.

Più risposte (0)

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by