Matlab: - Matrix Laboratory
Matlab: - Matrix Laboratory
- Matrix Laboratory
To invoke matlab
type cd\matlab\bin
at DOS prompt
C:\
> cd\matlab\bin
C:\MATLAB\BIN
Now type
matlab
demo
self learn.
A =
[1 b 2 ;4 b 6 ]
A =
1 2 4 6
If you type
A = [ 1 b 2 ; 4 b 6 ] ;
p (s) = 2s + 1 q (s) = s + 4
2+ 3s
Evaluate n (s) at s = - 5
value =
polyval ( n, - 5 )
value = - 66
G1
G2
2) s
G1 = 1 / (500
G2 = ( s +1 ) / ( s + 2 )
1 500 s 2
>>
G1
+
G2 +
>>
ng4 dg4
500 1000
1 0
1 s+1
>> ng = [1]; >> dg = [1 1] ; > > [nt, dt] = cloop (ng , dg, -1)
.... .
nt
0 dt >> = 1
1 2
1 s+1
nt =
0 1
0
dt =
1
> >
G = 1/ (500
2) s
H = (s + 1) / (s + 2)
nt =
0 0 1 2
dt = 500 1000 1 1
H2
_
R +
_
G1
G2
+ +
G3
G4
H1
G1 = 1 / ( s + 10 )
>> ng1 = [1]; >> dg1 = [ 1 10 ];
G2 = 1 / ( s + 1 )
G3 = ( + 1 ) / 2 +4s +4 ) (s
2 s
ng3 = [ 1 0 1 ]; dg3 = [ 1 4 4 ];
G4 = ( s +1 ) / ( s + 6 )
>> ng4 = [ 1 1 ];
>> dg4 = [1 6 ];
H1 = ( s + 1 ) / ( s + 2 )
nh1 = [1 1] ; dh1 = [1 2 ];
H2 = 2
nh2 = [ 2 ]; dh2 = [ 1 ];
H2
_
R +
_
G1
G2
+ +
G3
G4
H1
Steps in reduction :
Move H2 ahead of G4
Eliminate G3 G4 H1 loop
eliminate H 2 loop
eliminate the third loop
H2
_
R +
_
G1
G2
+ +
G3
G4
H1
num / den =
2s +12 -------s+1
eliminate G3 G4 H1 loop
H2 / G4
_
R +
_
G1
G2
+ +
G3
G4
H1
[ n2 , d2 ] = series
(ng3 , dg3 ,ng4, dg4);
eliminate H2 loop
H2 / G4 R + -
G1
G2
+ -
G1
[ nt, dt ] = cloop
( n6, d6, -1 );
num / den =
s^5+4s^4+6s^3+6s^2+5s+2 --------------------------------------------------------------------12s^6 +205s^5 +1066s^4 + 2517s^3+ 3128s^2+2196s+712