how can I make a colored 2D-surface in a polar plot? I want to give some labels to this polar... It is possible?
조회 수: 4 (최근 30일)
이전 댓글 표시
clc
c=input('How many blades are there in the blower?:');
t = 0:.01:2*pi;
if mod(c,2)==1 polar(t,(cos((c*t))),'-r') else polar(t,(cos((c/2)*t).^2),'-r') end
% find all of the text objects in the polar plot
h = findall(gcf,'type','text');
% delete the text objects
delete(h);
댓글 수: 0
채택된 답변
Joseph Cheng
2015년 7월 7일
the fill is a bit temperamental (does not work for odd blades). but it should be a starting point for you to look further.
clc
% c=input('How many blades are there in the blower?:');
c=randi(6,1,1);
t = 0:.01:2*pi;
if mod(c,2)==1
ph = polar(t,(cos((c*t))),'-r')
else
ph = polar(t,(cos((c/2)*t).^2),'-r')
end
% find all of the text objects in the polar plot
h = findall(gcf,'type','text');
% delete the text objects
delete(h);
patch(get(ph,'XData'), get(ph,'YData'), 'g')
fins = linspace(0,360,c+1);
for ind = 1:c
txtx = 1.2*cosd(fins(ind));
txty = 1.2*sind(fins(ind));
text(txtx,txty,['fin ' num2str(ind)])
end
추가 답변 (1개)
bio lim
2015년 7월 8일
clc
c=input('How many blades are there in the blower?:');
t = 0:.01:2*pi;
if mod(c,2)==1
radius = cos(c*t);
radius(radius <= 0) = 0;
ph = polar(t,(radius),'-r')
else
ph = polar(t,(cos((c/2)*t).^2),'-r')
end
% find all of the text objects in the polar plot
h = findall(gcf,'type','text');
% delete the text objects
delete(h);
patch(get(ph,'XData'), get(ph, 'YData'), 'b')
The rest is the code from Cheng, except the 'fins' was renamed to 'Blade' as the image suggested.
fins = linspace(0,360,c+1);
for ind = 1:c
txtx = 1.2 * cosd(fins(ind));
txty = 1.2 * sind(fins(ind));
text(txtx,txty,['Blade ' num2str(ind)])
end
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Spectral Measurements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!