plot 2 matrix together

24 次查看(过去 30 天)
Wei Jun Chan
Wei Jun Chan 2020-11-13
回答: KSSV 2020-11-13
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 个评论
Rik
Rik 2020-11-13
What determines if the symbol should be a dot or a circle?

请先登录,再进行评论。

回答(1 个)

KSSV
KSSV 2020-11-13
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,'*')

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by