Cody

Problem 1305. Creation of 2D Sinc Surface

Solution 1202072

Submitted on 1 Jun 2017 by George Pantazis
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
nrc=65; xymax=3; freq=1; m=sinx_div_x(xymax,nrc,freq); %figure(3);imagesc(m) %figure(4);surf(m) xv=repmat(-xymax:2*xymax/(nrc-1):xymax,nrc,1); yv=xv'; mexp=zeros(nrc); for r=1:nrc for c=1:nrc Rv=sqrt(xv(r,c)^2+yv(r,c)^2); if Rv>eps mexp(r,c)=sin(Rv*pi*freq)/(Rv*pi*freq); else mexp(r,c)=1; end end % c end %r %figure(1);imagesc(mexp) %figure(2);surf(mexp) assert(~any(any(isnan(m)))) assert(max(max(abs(m-mexp)))<.01)

ans = Columns 1 through 17 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 -2.5312 -2.4375 -2.3438 -2.2500 -2.1562 -2.0625 -1.9688 -1.8750 -1.7812 -1.6875 -1.5938 -1.5000 -3.0000 -2.9062 -2.8125 -2.7188 -2.6250 ...

2   Pass
nrc=127; xymax=3; freq=4; m=sinx_div_x(xymax,nrc,freq); %figure(3);imagesc(m) %figure(4);surf(m) xv=repmat(-xymax:2*xymax/(nrc-1):xymax,nrc,1); yv=xv'; mexp=zeros(nrc); for r=1:nrc for c=1:nrc Rv=sqrt(xv(r,c)^2+yv(r,c)^2); if Rv>eps mexp(r,c)=sin(Rv*pi*freq)/(Rv*pi*freq); else mexp(r,c)=1; end end % c end %r %figure(1);imagesc(mexp) %figure(2);surf(mexp) assert(~any(any(isnan(m)))) assert(max(max(abs(m-mexp)))<.01)

ans = Columns 1 through 17 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 -2.7619 -2.7143 -2.6667 -2.6190 -2.5714 -2.5238 -2.4762 -2.4286 -2.3810 -2.3333 -2.2857 -2.2381 -3.0000 -2.9524 -2.9048 -2.8571 -2.8095 ...

3   Pass
nrc=96; xymax=16; freq=0.5; m=sinx_div_x(xymax,nrc,freq); %figure(3);imagesc(m) %figure(4);surf(m) xv=repmat(-xymax:2*xymax/(nrc-1):xymax,nrc,1); yv=xv'; mexp=zeros(nrc); for r=1:nrc for c=1:nrc Rv=sqrt(xv(r,c)^2+yv(r,c)^2); if Rv>eps mexp(r,c)=sin(Rv*pi*freq)/(Rv*pi*freq); else mexp(r,c)=1; end end % c end %r %figure(1);imagesc(mexp) %figure(2);surf(mexp) assert(~any(any(isnan(m)))) assert(max(max(abs(m-mexp)))<.01)

ans = Columns 1 through 17 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 -14.3158 -13.9789 -13.6421 -13.3053 -12.9684 -12.6316 -12.2947 -11.9579 -11.6211 -11.2842 -10.9474 -10.6105 -16.0000 -15.6632 -15.3263 -14.9895 -14.6526 ...

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!