hello, this is a trivial question, m new to matlab. So please help me in this. It says "Input argument "D1" is undefined." code for cascading of two systems.
1 view (last 30 days)
Show older comments
function [A,B,C,D,pmr]=cas(N1,D1,N2,D2)
r=length(D1);
norder= r-1;
[a1,b1,c1,d1]=tf2ss(N1,D1);
[a2,b2,c2,d2]=tf2ss(N2,D2);
A= [a1 zeros(norder); b2*c1 a2];
B= [b1; b2*d1];
C= [d2*c1 c2];
D= [d2*d1];
x=horzcat(A,B);
y=horzcat(C,D);
pmr= vertcat(x,y);
end
0 Comments
Answers (1)
the cyclist
on 25 Mar 2015
How are you calling the function cas when you use it?
If you are calling it with only one input argument, then D1 is going to be undefined.
0 Comments
See Also
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!