Matlab question

GEC: Discuss gaming, computers and electronics and venture into the bizarre world of STGODs.

Moderator: Thanas

Post Reply
User avatar
The Jester
Padawan Learner
Posts: 475
Joined: 2005-05-30 08:34am
Location: Japan

Matlab question

Post by The Jester »

If I have two vectors which hold the coefficients for the transfer function of an analog filter (one vector for the numerator and one for the denominator) and a second pair of vectors which describe a the tranfer function of a digital filter, how would I go about plotting both systems' frequency responses on a single graph?
User avatar
Xenophobe3691
Sith Marauder
Posts: 4334
Joined: 2002-07-24 08:55am
Location: University of Central Florida, Orlando, FL
Contact:

Post by Xenophobe3691 »

Depends. How do you want it arranged?

Generally, you can use the subplot command as so:

Code: Select all

subplot(# of plots, Arrangement of plots, Plot#);plot(t,x);then the rest.
Example:

Code: Select all

subplot(2,1,1);
subplot(2,1,2);
Would create:

Code: Select all

Plot 1               Plot 2
Whereas:

Code: Select all

subplot(2,2,1);
subplot(2,2,2);
Would create:

Code: Select all

Plot 1


Plot 2
Dark Heresy: Dance Macabre - Imperial Psyker Magnus Arterra

BoTM
Proud Decepticon

Post 666 Made on Fri Jul 04, 2003 @ 12:48 pm
Post 1337 made on Fri Aug 22, 2003 @ 9:18 am
Post 1492 Made on Fri Aug 29, 2003 @ 5:16 pm

Hail Xeno: Lord of Calculus -- Ace Pace
Image
User avatar
The Jester
Padawan Learner
Posts: 475
Joined: 2005-05-30 08:34am
Location: Japan

Post by The Jester »

Xenophobe3691 wrote:Depends. How do you want it arranged?
Similar to the output figure of freqz or freqs with plots for both magnitude and phase responses for both filters.
Gerald Tarrant
Jedi Knight
Posts: 752
Joined: 2006-10-06 01:21am
Location: socks with sandals

Post by Gerald Tarrant »

If you want multiple functions in the same plot/axes you can also use the

"hold"

or

"hold all"

hold all assigns different colors to each function
The rain it falls on all alike
Upon the just and unjust fella'
But more upon the just one for
The Unjust hath the Just's Umbrella
Post Reply