MATLAB Answers

Error while plotting matrix of complex numbers

1 view (last 30 days)
chirag  rohit
chirag rohit on 3 Aug 2020
Edited: chirag rohit on 3 Aug 2020
clc
clear all
sub=[ -1.1691 + 113.64i; -9.0587 + 137.23i; -10.221 + 166.23i; -9.6819 + 197.8i; -8.5346 + 233.76i;
-1.1691 - 113.64i; -9.0587 - 137.23i; -10.221 - 166.23i; -9.6819 - 197.8i; -8.5346 - 233.76i];
sup=[ -13.605 + 570.94i; -12.344 + 556.39i; -11.068 + 539.83i; -9.7952 + 520.39i; -8.4823 + 496.4i;
-13.605 - 570.94i; -12.344 - 556.39i; -11.068 - 539.83i; -9.7952 - 520.39i ; -8.4823 - 496.4i];
TI=[ -86.534 + 37.766i; -85.883 + 37.936i; -85.384 + 38.191i; -84.9 + 38.399i; -84.506 + 38.589i;
-86.534 - 37.766i; -85.883 - 37.936i; -85.384 - 38.191i; -84.9 - 38.399i; -84.506 - 38.589i];
shaft=[ -0.48455 + 6.1504i; -0.48842 + 6.1493i; -0.4907 + 6.1486i; -0.49212 + 6.1481i; -0.49306 + 6.1477i;
-0.48455 - 6.1504i; -0.48842 - 6.1493i; -0.4907 - 6.1486i; -0.49212 - 6.1481i ; -0.49306 - 6.1477i];
EM=[ -19.362 + 91.845i ; -9.6224 + 94.729i; -6.5132 + 94.265i; -5.1096 + 94.093i; -4.3018 + 94.032i;
-19.362 - 91.845i; -9.6224 - 94.729i; -6.5132 - 94.265i ; -5.1096 - 94.093i; -4.3018 - 94.032i];
plot(sub,'r-',sub,'b*');
hold on;
plot(sup,'r-',sub,'b^');
hold on;
plot(TI,'r-',TI,'bx');
hold on;
plot(EM,'r-',EM,'bv');
hold on;
plot(shaft,'r-',shaft,'bs');
hold off

  0 Comments

Sign in to comment.

Accepted Answer

madhan ravi
madhan ravi on 3 Aug 2020
plot(real(sub), 'r-', imag(sub) ,'b*');

  3 Comments

chirag  rohit
chirag rohit on 3 Aug 2020
Actually i wanted to join complex numbers in matrix named 'sub' marked by blue colored * symbol and want to join all them by red color line. Likewise for remaining matrices.
madhan ravi
madhan ravi on 3 Aug 2020
plot(real(sub), imag(sub) ,'b*', real(sub), imag(sub) , 'r')

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by