%%%%%%%%%%%%%%%%%%%%%%%%%%本脚本用于绘制方向图极坐标%%%%%%%%%%%%%%%%%%%% %作者: %编写时间:2022年03月 clc;clear;close all; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%各观测量原始数据提取%%%%%%%%%%%%%%%%%%%%%%%%%%% FileName=['MeasPatternValueFile','.txt']; FilePath='C:\Users\longrt\Desktop\'; Direction_Data=importdata(fullfile(FilePath,FileName),' '); X1=Direction_Data(:,1); Y1=Direction_Data(:,2); X2=Direction_Data(:,3); Y2=Direction_Data(:,4); a = sqrt(X1.^2 + Y1.^2); b = sqrt(X2.^2 + Y2.^2); theta = linspace(0,2*pi); %绘制圆环 rho = sin(theta); rho2= cos(theta); polarplot(theta,rho,':r','LineWidth',1.5); hold on; polarplot(theta,-rho,':r','LineWidth',1.5); hold on; polarplot(theta,rho2,':b','LineWidth',1.5); hold on; polarplot(theta,-rho2,':b','LineWidth',1.5); hold on; polarplot(a,'b','LineWidth',1.5); hold on; polarplot(b,'r','LineWidth',1.5); pax = gca; pax.ThetaDir = 'clockwise'; pax.ThetaZeroLocation = 'top'; % 将0度放在顶部 pax.FontSize = 14; %极坐标系字号大小 rlim([0 1.6]); % 设置半径范围 rticks([0.5 1 1.5]) % 在r=0.6、1.6、2处显示刻度 pax.RColor = 'blue'; % 设置刻度的颜色 pax.GridColor = 'b'; % 设置刻度线颜色

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/227545.html原文链接:https://javaforall.net
