Matlab code Help
- From: "bobby110uk" <bobby110uk@xxxxxxxxxxx>
- Date: Tue, 28 Feb 2006 08:50:15 -0600
How to I add another arc to this code shown below. Thanx
-------------------------Code--------------------------------------------
function [array]=test4
clear
N = 256;
mx = N/2 + 1;
%Setting up the coords
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)
----------------------End of code---------------------------------------
.
- Prev by Date: Re: Channel modelling
- Next by Date: Re: Fourier Duality
- Previous by thread: fftshift
- Next by thread: instantaneous audio streaming
- Index(es):