Your function worked for me, without any error. And once I changed the number of points to a positive value it even plotted something:
sketch((@(x,y)exp(1+0.5.*cos(4*x).*(y-2))),-1,3,0,4,30) % note +30.
giving:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/187580/image.png)
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!