% This program calculates the phasor current I1 and
% phasor voltage Uc.
% impedance matrix
Z = [10-j*7.5   -6+j*5;
     -6+j*5     16+j*3];
% voltage vector
U = [5; -2*exp(j*75*pi/180)];  
I = inv(Z)*U; % solution for loop currents
Uc = -10*j*(I(1)-I(2));
I1_abs = abs(I(1));
I1_ang = angle(I(1))*180/pi;
Uc_abs = abs(Uc);
Uc_ang = angle(Uc)*180/pi;
disp('current I1:')
disp(['magnitude = ',num2str(I1_abs),' A'])
disp(['angle = ',num2str(I1_ang),'°'])
disp('_________________________')
disp('voltage Uc:')
disp(['magnitude = ',num2str(Uc_abs),' V'])
disp(['angle = ',num2str(Uc_ang),'°'])
