radius
- From: Bobby <bob@xxxxxxxxxxx>
- Date: Tue, 28 Feb 2006 12:38:57 -0500
How do i add another arc with a different radius to this code shown
below. Thanx
numpoint=10; %This determines the number of coordinate points within
an arc.
radius=0.5; %This determines the radius of the arc as a fraction of
the total width.
delq=((pi)/(numpoint+1));
for l=1:numpoint
[coordx(l),coordy(l)]=pol2cart((l-1)*delq+(delq/2),radius);
end
coordx=round(coordx*(N/2));
coordy=round(coordy*(N/2));
coordx=coordx+(N/2);
coordy=coordy+(N/2);
%fftshifting the coords
for n=1:length(coordx)
coordx(n)=coordx(n)+(N/2);
coordy(n)=coordy(n)+(N/2);
if coordx(n)>N
coordx(n)=coordx(n)-N;
end
if coordy(n)>N
coordy(n)=coordy(n)-N;
end
end
%Putting the (x,y) coords into a column vector, t
t=zeros(N);
nones = length(coordx);
nout = 2*nones;
for n=1:nones
t(coordy(n),coordx(n))=1;
end
figure(1) %Position of (coordx,coordy)
imagesc(fftshift(t))
colormap(gray)
.
- Follow-Ups:
- Re: radius
- From: Scott Seidman
- Re: radius
- Prev by Date: Re: radius
- Next by Date: Re: I can't start MATLAB 7.0(R14)
- Previous by thread: For loops
- Next by thread: Re: radius
- Index(es):
Relevant Pages
|