DSPRelated.com
Forums

Matlab coding help

Started by bobby110uk February 21, 2006
Hey guys 

I got a piece of code that uses a matrix 256 by 256. A set of x and y
coordinates are given which can be seen on the image when the code is
executed (code shown below). You will see in the image that the
coordinates create 3 half circle. I want help with increasing the gap
between these half circles maybe by using the radius. If possible in a
loop so it does the increasing method step by step and produces the
relevent image for that change. Any response will be appreciated

Thanx for your time guys

Bobby    

-----------------------------(CODE)------------------------------------- 

function [array]=wsmask256


clear %Removes all the variables from memory to avoid confusion.
N = 256; %This defines the size of the array describing the phase mask.
mx = N/2 + 1; %This sets the position of the pixel at the mid-point of the
matrix

t=0;

coordy=[247,247,240];
coordx=[245,N-245,256];
coordy=[coordy,231,238,250,250,238,231];
coordx=[coordx,248,239,232,N-232,N-239,N-248];
coordy=[coordy,236,225,216,216,225,236,211];
coordx=[coordx,222,232,244,N-244,N-232,N-222,256];


%Putting the (x,y) coords into a column vector, t

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)-----------------------------