156
Practical MATLAB
® Applications for Engineers
The matrix equation is then given by
15
5
5 35
10
0
1
2
Ϫ
Ϫ
I
I
ϭ
where the 2 × 2 matrix is the resistance matrix R and [10 0]
T represents the column vector V, as indicated by
[ ]
[ ]
R I
V
* [ ] ϭ
then
[ I] = [R] \ [V]
MATLAB Solution
>> % part (i) matrix solution
>> R = [15 -5;-5 35];
>> V = [10;0];
>> I = R\V;
>> Result = [I(1) I(2) I(1)-I(2)];
% results are printed
>> disp(‘**************************************’);
>> disp(‘**********R E S U L T S**************’);
>> disp(‘
Matrix current solutions’);
>> disp(‘**************************************’);
>> disp (‘The currents I1, I2, I3 are given by:’); disp(Result)
>> disp (‘
amp.
amp.
amp.’);
>> disp(‘**************************************’)
************************************************
***************R E S U L T S******************
Matrix current solutions
***********************************************
The currents I1, I2, I3 are given by:
0.7000
0.1000
0.6000
amp.
amp.
amp.
************************************************
>> % Part (ii); symbolic solution
>> sym I1 I2 I3;
>> disp(‘**************************************’)
FIGURE 2.53
Network of Example 2.14.
A
5 Ω
10 V
10 Ω
−
+
I
I 2
10 Ω
20 Ω
I 1
Loop # 1
Loop # 2
CRC_47760_CH002.indd 156
CRC_47760_CH002.indd 156
7/23/2008 1:38:49 PM
7/23/2008 1:38:49 PM
Practical MATLAB
® Applications for Engineers
The matrix equation is then given by
15
5
5 35
10
0
1
2
Ϫ
Ϫ
I
I
ϭ
where the 2 × 2 matrix is the resistance matrix R and [10 0]
T represents the column vector V, as indicated by
[ ]
[ ]
R I
V
* [ ] ϭ
then
[ I] = [R] \ [V]
MATLAB Solution
>> % part (i) matrix solution
>> R = [15 -5;-5 35];
>> V = [10;0];
>> I = R\V;
>> Result = [I(1) I(2) I(1)-I(2)];
% results are printed
>> disp(‘**************************************’);
>> disp(‘**********R E S U L T S**************’);
>> disp(‘
Matrix current solutions’);
>> disp(‘**************************************’);
>> disp (‘The currents I1, I2, I3 are given by:’); disp(Result)
>> disp (‘
amp.
amp.
amp.’);
>> disp(‘**************************************’)
************************************************
***************R E S U L T S******************
Matrix current solutions
***********************************************
The currents I1, I2, I3 are given by:
0.7000
0.1000
0.6000
amp.
amp.
amp.
************************************************
>> % Part (ii); symbolic solution
>> sym I1 I2 I3;
>> disp(‘**************************************’)
FIGURE 2.53
Network of Example 2.14.
A
5 Ω
10 V
10 Ω
−
+
I
I 2
10 Ω
20 Ω
I 1
Loop # 1
Loop # 2
CRC_47760_CH002.indd 156
CRC_47760_CH002.indd 156
7/23/2008 1:38:49 PM
7/23/2008 1:38:49 PM
