Skip to content

Instantly share code, notes, and snippets.

@sengupta
Created June 18, 2010 04:22
Show Gist options
  • Save sengupta/443230 to your computer and use it in GitHub Desktop.
Save sengupta/443230 to your computer and use it in GitHub Desktop.
Generate a "Hi" 3D plot in Scilab
x = linspace(-3,3,50);
y = linspace(-5,5,50);
[X Y]=meshgrid(x,y);
Z = exp(-X.^2-Y.^2/2).*cos(4*X) + exp(-3*((X+0.5).^2+Y.^2/2));
Z(Z>0.001)=0.001;
Z(Z<-0)=0;
surf(X,Y,Z);
title('$e^{-x^2 - \frac{y^2}{2}}\cos(4x) + e^{-3((x+0.5)^2+\frac{y^2}{2})}$')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment