plot 2 matrix together

1 view (last 30 days)
Wei Jun Chan
Wei Jun Chan on 13 Nov 2020
Answered: KSSV on 13 Nov 2020
Hello, I had 2 matrix as follows
y=[7.1165 9.6022 8.9144 9.2717 6.3400 4.0484 0.3411 -0.6784 -5.7726 -5.4925 -94523 -9.7232 -9.5054 -9.7908 -7.7300 -5.9779 -4.5535 -1.5042 -0.7044 3.2406 8.3029 6.1925 9.1178 9.0904 9.0662];
z=[0 3.1398 6.3739 9.5877 10.145 10.1919 9.0683 10.2254 7.5799 7.7231 5.4721 3.3990 0.9172 -1.3551 -5.2708 -9.7011 -9.4256 -9.3053 -9.3815 -9.8822 -8.1876 -8.7501 -4.5653 -1.9179 -1];
How do i plot this 2 matrix such that it will be like this.
  1 Comment
Rik
Rik on 13 Nov 2020
What determines if the symbol should be a dot or a circle?

Sign in to comment.

Answers (1)

KSSV
KSSV on 13 Nov 2020
Is this what you are looking for?
y=[7.1165 9.6022 8.9144 9.2717 6.3400 4.0484 0.3411 -0.6784 -5.7726 -5.4925 -9.4523 -9.7232 -9.5054 -9.7908 -7.7300 -5.9779 -4.5535 -1.5042 -0.7044 3.2406 8.3029 6.1925 9.1178 9.0904 9.0662];
z=[0 3.1398 6.3739 9.5877 10.145 10.1919 9.0683 10.2254 7.5799 7.7231 5.4721 3.3990 0.9172 -1.3551 -5.2708 -9.7011 -9.4256 -9.3053 -9.3815 -9.8822 -8.1876 -8.7501 -4.5653 -1.9179 -1];
th = linspace(0,2*pi,length(y)) ;
x1 = y.*cos(th) ; y1 = y.*sin(th) ;
x2 = z.*cos(th) ; y2 = z.*sin(th) ;
plot(x1,y1,'o',x2,y2,'*')

Community Treasure Hunt

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

Start Hunting!