Plotting curves with increasing radius
조회 수: 8 (최근 30일)
이전 댓글 표시
Dear all,
I wanted to know if there is any way to plot a curve with increasing radius. This curve has to go around a circle.
Thanks for your help.
댓글 수: 8
Image Analyst
2013년 8월 21일
Bring up your diagram somehow on the computer, be it in Photoshop or whatever. Type alt-Printscreen to capture the current window into the clipboard. Go to http://snag.gy and type control-V to paste it in. Note the URL it gives you and come back here and tell us what it is.
채택된 답변
Walter Roberson
2013년 8월 21일
Your sample diagram look like spirals to me, other than that the radius might not be increasing linearly.
Use pol2cart() to switch between an (r, theta) form vs (x,y) coordinates.
댓글 수: 3
Kelly Kearney
2013년 8월 21일
I see a circle and two spirals. Is this what you're looking for?
theta = linspace(pi/2+2*pi, pi/2, 100);
r = cell(3,1);
r{1} = ones(size(theta)); % The circle
r{2} = linspace(1, 0.5, 60); % Spiral in
r{3} = linspace(1, 1.5, 60); % Spiral out
for ii = 1:3
[x{ii}, y{ii}] = pol2cart(theta(1:length(r{ii})), r{ii});
end
xy = [x;y]; plot(xy{:}); axis equal;
추가 답변 (2개)
Image Analyst
2013년 8월 21일
You say "I have the data for them" so why don't you just use the plot() function and plot them? Am I missing something???
David Sanchez
2013년 8월 21일
Try this out:
[x,y] = meshgrid(1:150,1:100);
[th, rho] = cart2pol(x - 75,y - 50); % convert to polar
% spiral centered at (75,50)
Img = sin(r/3 + th);
imagesc(Img); colormap(hot);
axis equal; axis off;
참고 항목
카테고리
Help Center 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!