diag
in matlab is not the same as blkdiag
. The overloaded LTI operator is the blkdiag
to put things on a diagonal of a matrix structure.
In your case, it is done simply by
tf1=tf([1 -1],[1 1]);
tf2=tf([1 2],[1 4 5]);
tf3=tf([1 2],[5 4 1]);
G = blkdiag(tf1,tf2,tf3)
The MIMO syntax requires cells to distinguish the polynomial entries from the MIMO structure. Moreover, it does not like identically zero denominator entries (which is understandable) hence if you wish to enter in the mimo context you need to use
G = tf({[1 -1],0,0;0,[1 2],0;0,0,[1 2]},{[1 1],1,1;1,[1 4 5],1;1,1,[5 4 1]})
or in your syntax
Num = {[1 -1],0,0;0,[1 2],0;0,0,[1 2]};
Den = {[1 1],1,1;1,[1 4 5],1;1,1,[5 4 1]};
tf(Num,Den)
Instead of ones you can basically use anything valid nonzero entries.