Plotting bode's plot in MATLAB --- seeing problem

Status
Not open for further replies.

freescale_bharat

Junior Member level 1
Joined
Jan 9, 2008
Messages
16
Helped
3
Reputation
6
Reaction score
1
Trophy points
1,283
Activity points
1,382
Guys .. I am new to MATLAB

trying to plot bode's plot ...

MagH=16564.3*sqrt(w.^2+7574620^2)./sqrt(w.^2+836.738^2).*sqrt(w.^2+1346260^2).*sqrt(w^2+66497800^2);

I have set of poles and zeros with DC gain .. , the error message I am getting is

Error using ==> mpower
Matrix must be square.

not sure what does Matrix must be square means ..

any help is much appreciated ...
 

Matlab by default deals with matrices. When you include ^2, it means matrix squaring which can be performed only for a square matrix. As you are dealing with vectors, use .^2 as you have done for all multiplications and divisions. Just the last w^2 is wrong here.
BTW a better way to plot bode would be to use tf and use bode command.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…