MATLAB Answers

I have complex output values, but the output displays the 0 of the other half as well

1 view (last 30 days)
Mohamad Ayoub
Mohamad Ayoub on 21 Nov 2020
Edited: Mohamad Ayoub on 22 Nov 2020
Impedence Matrix
__________________
0+9i 0+1i
0+1i 67+19i
how can i get the first element output to be only 9i instead of having the extra 0 with no use
disp('The impedance matrix to solve the mesh current is:')
fprintf('\n')
disp(table(Imp,'VariableNames',{'Impedence Matrix'}))
fprintf('\n')
Iam using this code

  0 Comments

Sign in to comment.

Answers (1)

VBBV
VBBV on 22 Nov 2020
Edited: VBBV on 22 Nov 2020
M= [ 0+9i 0+1i ; 0+1i 67+19i]
disp(table(imag(M),'VariableNames',{'Impedence Matrix'}))
%Imp = table(real(M))

  1 Comment

Mohamad Ayoub
Mohamad Ayoub on 22 Nov 2020
this got rid of the (i) and the real part of 67+19i
i only want the program to not display a 0 when either the real or imaginary part doesnt exist

Sign in to comment.

Tags

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!