Problem 1305. Creation of 2D Sinc Surface
This Challenge is to efficiently create the Sombrero function of various sizes, resolutions, and frequencies.

Figure Example: Freq=1; XY_max_value=3; Num Rows / Cols 64
Create the 2-D array m(row,col)=sin(pi*R*freq)/(pi*R*freq) where R is the distance from the center of the array. The array is [nrc,nrc] with X(1,1)=Y(1,1)= - xymax and X(nrc,nrc)=Y(nrc,nrc)=xymax.
Input: [xymax,nrc,freq]
Output: [m] an array of size(nrc,nrc) representing the sin(x)/x function
Hints:
Matlab provides excellent functions and array operators to readily create vectors and grids. [ linspace, meshgrid ]
Future:
Polar grid creation to produce Zernike surfaces
Solution Stats
Problem Comments
- 
		2 Comments
Cody, unfortunately, is not recognizing the sinc function of the image processing toolbox. Usage of sinc make for nice tight code
The usage of nan as a solution has required imposing an additional check. The Challenge intent was to use sinc but Cody is sinc-less thus a 0 divide check is required.
Solution Comments
Show commentsProblem Recent Solvers24
Suggested Problems
- 
         
         22423 Solvers 
- 
         
         1665 Solvers 
- 
         Sum of first n terms of a harmonic progression 472 Solvers 
- 
         middleAsColumn: Return all but first and last element as a column vector 629 Solvers 
- 
         Make a random, non-repeating vector. 10585 Solvers 
More from this Author308
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!