Re: radius
- From: Scott Seidman <namdiesttocs@xxxxxxxxxxxxxx>
- Date: 28 Feb 2006 17:33:02 GMT
Bobby <bob@xxxxxxxxxxx> wrote in news:ef2a759.-1@xxxxxxxxxxxxxxxx:
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)
Have you considered going to matlab help and selecting "Getting started"?
The answer to every one of your questions is essentially the same. While
there are some steps that can be skipped by changing variable names:
1. Run your algorithm at one radius;
2. Store the results somewhere they wont get overwritten
3. Run your algorithm at a second radius.
If you don't understand steps two and three, you're in over your head.
--
Scott
Reverse name to reply
.
- References:
- radius
- From: Bobby
- radius
- Prev by Date: Re: transforming some columns to 0
- Next by Date: radius
- Previous by thread: radius
- Next by thread: I have a simple subroutine in fortran and i want to call it from matlab. Why do i get "1 unresolved external" when i compile?
- Index(es):
Relevant Pages
|