%example7p17
%define the RHS vector.
ir=zeros(5,1); %initialize and define non zero values
ir(1)=12*cos(30*pi/180)+j*12*sin(30*pi/180);
ir(5)=2*cos(pi/4)+j*2*sin(pi/4), %echo the vector
%now define the matrix
y=[1,0,0,0,0; %first row
   -1,1+0.5j,-j,0,0.5j; %second row
   0,-j,1.5+j,0,-0.5; %third row
   -0.5,0,0,1.5+j,-1; %fourth row
   0,0.5i,-0.5,-1,1.5+0.5i] %last row and do echo
v=y\ir %solve equations and echo the answer
Echo of RHS
ir =
  10.3923 + 6.0000i
        0         
        0
        0         
   1.4142 + 1.4142i
y =
  Columns 1 through 4
   1.0000                  0                  0                  0         
  -1.0000             1.0000 + 0.5000i        0 - 1.0000i        0         
        0                  0 - 1.0000i   1.5000 + 1.0000i        0         
  -0.5000                  0                  0             1.5000 + 1.0000i
        0                  0 + 0.5000i  -0.5000            -1.0000         
  Column 5
        0         
        0 + 0.5000i
  -0.5000         
  -1.0000         
   1.5000 + 0.5000i
Echo of Matrix
v =
  10.3923 + 6.0000i
   7.0766 + 2.1580i
   1.4038 + 2.5561i
   3.7661 - 2.9621i
   3.4151 - 3.6771i
Echo of Answer