/ concept-collection / sample-4
Sign in
concept-collection / sample-4
sample-4 / scripts / surface_demo.m
15 lines · 424 BCodeBlameHistory
8a3780bInitial commitJeremy Magland 1% 3-D surface demo. mexican_hat lives in ../lib, so put that folder on
2% the search path first (files next to the running script are found
3% automatically; other folders follow MATLAB's addpath rules).
4addpath('../lib');
6[X, Y] = meshgrid(linspace(-3, 3, 80), linspace(-3, 3, 80));
7Z = mexican_hat(X, Y);
9figure;
10surf(X, Y, Z);
11title('Mexican hat');
12xlabel('x');
13ylabel('y');
15disp('surface rendered — drag to rotate');
moveopenescclose