156 Practical MATLAB® Applications for Engineers
The matrix equation is then given by15 5
53510
01
2
I
I
where the 2 × 2 matrix is the resistance matrix R and [10 0]T represents the column vec-
tor V, as indicated by[]RI 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.
A10 V^5 Ω10 Ω−+II 210 Ω20 ΩI 1Loop # 1 Loop # 2