怎么用matlab画极坐标图

我要用matlab画极坐标图,一共有12个点的数据m0=0.1349θ=0°m1=0.1257θ=30°m2=0.1405θ=60°m3=0.1468θ=90°m4=0.... 我要用matlab画极坐标图,一共有12个点的数据
m0=0.1349 θ=0°
m1=0.1257 θ=30°
m2=0.1405 θ=60°
m3=0.1468 θ=90°
m4=0.1399 θ=120°
m5=0.1422 θ=150°
m6=0.1612 θ=180°
m7=0.1578 θ=210°
m8=0.1402 θ=240°
m9=0.1393 θ=270°
m10=0.1228 θ=300°
m11=0.1302 θ=330°
前面为数据值,后面是它在极坐标中的角度。
怎么用极坐标图画出来,然后用平滑的曲线连起来。
最好先把数据能归一化。
展开
 我来答
浮现的林间八重樱
2018-09-23
知道答主
回答量:22
采纳率:50%
帮助的人:2.7万
展开全部

1.非封闭曲线,已归一化

clc

clear

t=0:pi/6:(2-1/6)*pi%初始化极角

m=[0.1349 0.1257 0.1405 0.1468 0.1399 0.1422 0.1612  0.1578  0.1402 0.1393 0.1228 0.1302];%初始化矢径

mm=mapminmax(m,0,1);%矢径数据归一化,归一化函数可以根据需求选取

polar(t,mm,'-');

2.封闭曲线,已归一化

clc

clear

t=0:pi/6:(2-1/6)*pi;%初始化极角

m=[0.1349 0.1257 0.1405 0.1468 0.1399 0.1422 0.1612  0.1578  0.1402 0.1393 0.1228 0.1302];%初始化矢径

mm=mapminmax(m,0,1);%矢径数据归一化,归一化函数可以根据需求选取

t=[t,t(1)];

mm=[mm,mm(1)];

polar(t,mm,'-');

这样可以了吗?

newbiejasper
推荐于2017-09-05 · TA获得超过442个赞
知道小有建树答主
回答量:528
采纳率:66%
帮助的人:286万
展开全部

polar可用于描绘极坐标图像。

最简单而常用的命令格式:POLAR(THETA, RHO) 

其中,THETA是用弧度制表示的角度,RHO是对应的半径。

例:

a=-2*pi:.001:2*pi; %设定角度
b=(1-sin(a)); %设定对应角度的半径
polar(a, b,'r') %绘图

得到

已赞过 已踩过<
你对这个回答的评价是?
评论 收起
Miafifi
2018-10-09 · TA获得超过450个赞
知道小有建树答主
回答量:277
采纳率:93%
帮助的人:156万
展开全部

Basically, there are two ways to visualise the polar dataset provided above! I will start from the straightforward way in which the data is plotted in polar coordinates directly, to the alternative way in which the data is plotted in Cartesian coordinates instead.

- Firstly, you need to create two arrays which store the polar point consisting of theta and rho seperately, as follow:

theta = 0.0 : 30.0 : 330.0;
rho = [ 0.1349, 0.1257, 0.1405, 0.1468, 0.1399, 0.1422, 0.1612, 0.1578, 0.1402, 0.1393, 0.1228, 0.1302 ];

- Plot line in polar coordinates

polarplot( deg2rad(theta), rho );

- Plot line in Cartesian coordinates

[ x, y ] = pol2cart( deg2rad(theta), rho );
plot( x, y );

Personally, the second plot is easier in visualisation but the transformation from polar coordinates to Cartesian ones must be made after the initialisation of variables.

已赞过 已踩过<
你对这个回答的评价是?
评论 收起
shine戚七七
2015-09-22 · TA获得超过4.7万个赞
知道大有可为答主
回答量:2万
采纳率:75%
帮助的人:2275万
展开全部
极坐标画图
polar(phase, amp, ' ')

-----------------------------------------------------------------------------------------------------------------------
%%%%%%%%%%%%%%%%%%%%%
%plot your figure before
%%%%%%%%%%%%%%%%%%%%%
% figure resize
set(gcf,'Position',[100 100 260 220]);
set(gca,'Position',[.13 .17 .80 .74]);
figure_FontSize=8;
set(get(gca,'XLabel'),'FontSize',figure_FontSize,'Vertical','top');
set(get(gca,'YLabel'),'FontSize',figure_FontSize,'Vertical','middle');
set(findobj('FontSize',10),'FontSize',figure_FontSize);
set(findobj(get(gca,'Children'),'LineWidth',0.5),'LineWidth',2);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
解释:
set(gcf,'Position',[100 100 260 220]);
这句是设置绘图的大小,不需要到word里再调整大小。我给的参数,图的大小是7cm
set(gca,'Position',[.13 .17 .80 .74]);
这句是设置xy轴在图片中占的比例,可能需要自己微调。
figure_FontSize=8;
set(get(gca,'XLabel'),'FontSize',figure_FontSize,'Vertical','top');
set(get(gca,'YLabel'),'FontSize',figure_FontSize,'Vertical','middle');
set(findobj('FontSize',10),'FontSize',figure_FontSize);
这4句是将字体大小改为8号字,在小图里很清晰
set(findobj(get(gca,'Children'),'LineWidth',0.5),'LineWidth',2);
这句是将线宽改为2
plot(1:T, pos, 'color', [0 0 0], 'LineWidth', 2);
hold on;
plot(1:T, B(:, i), 'color', [0 1 0], 'LineWidth', 2);
plot(1:T, G(:, i), 'color', [0 0 1], 'LineWidth', 2);
plot(1:T, R(:, i), 'color', [1 0 0], 'LineWidth', 2);
xlabel('Time');
ylabel('Position');
axis([1 200 -0.05 0.15])
legend('True state', 'Bayes', 'Particle filter', 'Heddge filter', 'Location','NorthWest');
images_fname = [folder '/images/' sprintf('demo1_sigma_%.3f_rho_%.3f_alpha_%.3f.eps',sigma_o, rho, alpha)];
% print('-r80','-dpng',images_fname);
set(gcf, 'PaperPositionMode', 'manual');
set(gcf, 'PaperUnits', 'inches');
set(gcf, 'PaperPosition', [0.25 2.5 8 4]); % 输出大小由后面两个数确定,原来的输出大小是8 6
print('-r300', '-depsc2', images_fname);
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
ValleyGYZ
推荐于2018-02-01 · TA获得超过489个赞
知道小有建树答主
回答量:364
采纳率:100%
帮助的人:127万
展开全部
theta=0:1/6*pi:11/6*pi;
m=[0.1349 0.1257 0.1405 0.1468 0.1399 0.1422 0.1612 0.1578 0.1402 0.1393 0.12228 0.1302];
polar(theta,m)
zoom on
这一个运行一下你看看行不
本回答被提问者和网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(6)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式