Created
August 30, 2019 15:12
-
-
Save gugarosa/f784d31eda34d139146da8fbbf9dcee2 to your computer and use it in GitHub Desktop.
It creates a 3D plot of a pre-defined mathematical function.
This file contains 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
% Function to be plotted | |
z = @(x,y) (sin(x) * sqrt(x)) * (sin(y) * sqrt(y)); | |
% Plots the function | |
h = fsurf(z,[0 10]); | |
% Defines some attributes on its positioning and brightness | |
camlight(110,70) | |
brighten(0.7) | |
h.EdgeColor = 'none'; | |
h.AmbientStrength = 0.6; | |
% Defines its color map | |
colormap jet; | |
% Creates the box around the plot | |
a = gca; | |
a.Box = 'on'; | |
a.BoxStyle = 'full'; | |
% Defines labels and title | |
xlabel('x', 'FontWeight', 'bold', 'FontSize', 14); | |
ylabel('y', 'FontWeight', 'bold', 'FontSize', 14); | |
zlabel('z', 'FontWeight', 'bold', 'FontSize', 14); | |
title('f(x, y) = sin(x) * sqrt(x) * sin(y) * sqrt(y)'); | |
% If necessary, re-render amount of desired ticks | |
a.XTick = 0:5:10; | |
a.YTick = 0:5:10; | |
a.ZTick = -6:6:6; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment