-
-
Save caiorss/c55932501f14600b6d09a1f1ab2719e3 to your computer and use it in GitHub Desktop.
MATLAB implicit plot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Credits to Vincent Morio | |
% http://www.mathworks.com/matlabcentral/newsreader/view_thread/152947 | |
% Limits | |
xlims = [-5 5]; | |
ylims = [-5 5]; | |
zlims = [-5 5]; | |
steps = 30; | |
noedge = true; | |
[Y,X,Z] = ... | |
ndgrid(... | |
linspace(xlims(1),xlims(2),steps),... | |
linspace(ylims(1),ylims(2),steps),... | |
linspace(zlims(1),zlims(2),steps)); | |
impfunc = sinh(X).^2-sinh(Y).^2-1; % Function here | |
p = patch(isosurface(X,Y,Z,impfunc,0)); | |
isonormals(X,Y,Z,impfunc,p); | |
set(p,'FaceColor','b','EdgeColor','k','FaceAlpha',0.5); | |
if (noedge) | |
set(p,'EdgeColor','none'); | |
end | |
daspect([1 1 1]) | |
axis square; | |
grid on; | |
camlight | |
view(-27,46); | |
lighting gouraud |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment