Connect all dots I polarplot

13 次查看(过去 30 天)
Kalle
Kalle 2023-4-17
评论: Kalle 2023-4-17
Hello, I would like to connect the last item with the first one, so I get a “circle”. I know how to connect the dots at the polarscatter but how do I connect the last dot with the first one without changing the vector s?
clc;
clear all;
r=[10:36:360]
r = r/360*2*pi
s=[5,3.5,5,4,4,3.5,4,4.2,4.7,4]
polarplot(r,s,'-x')

回答(1 个)

Alan Stevens
Alan Stevens 2023-4-17
Like this?
r=[10:36:360 10];
r = r/360*2*pi;
s=[5,3.5,5,4,4,3.5,4,4.2,4.7,4, 5];
polarplot(r,s,'-x')
  3 个评论
Alan Stevens
Alan Stevens 2023-4-17
" but now you changed the vector s and addeed an other dot"
Why don't you want to do that?
Here's another possibility:
r=10:36:360;
r = r/360*2*pi;
s=[5,3.5,5,4,4,3.5,4,4.2,4.7,4];
r2 = [334 10];
r2 = r2/360*2*pi;
s2 = [4 5];
polarplot(r,s,'-bx', r2, s2, '-bx')

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by