Plotting all the columns of a matrix
Show older comments
Hi,
I want to plot columns of two matrices Z_imag and Z_real in two separate graphs.
I tried to do this code but I wasnt able to:
Z_imag=randi(10,10,3);
Z_real=randi(10,10,3);
width_mil=1:10
for i=1:1:3
figure(1)
Z_im = axes;
plot( Z_im,width_mil,Z_imag(:,i),'-o');
title('Imaginary part of the impedance');
xlabel('W [mil]');
ylabel('Im{Z}');
figure(2)
Z_re = axes;
plot(Z_re,width_mil,Z_real(:,i),'-o');
title('Real part of the impedance');
xlabel('W [mil]');
ylabel('re{Z}');
end
2 Comments
the cyclist
on 29 Aug 2019
Can you upload your data in a MAT file, so that we can execute your code?
Vinay Killamsetty
on 29 Aug 2019
Edited: Vinay Killamsetty
on 29 Aug 2019
Accepted Answer
More Answers (1)
madhan ravi
on 29 Aug 2019
Edited: madhan ravi
on 29 Aug 2019
No loops needed:
plot(mat)
axis([0,5,0,5])
1 Comment
KALYAN ACHARJYA
on 29 Aug 2019
Edited: KALYAN ACHARJYA
on 29 Aug 2019
Yes @Madhan +1 Thanks
Categories
Find more on MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


