In this video, we’ll learn how to plot a 3D surface in MATLAB using the function:
z = sin(x) × cos(y)
This tutorial is perfect for beginners who want to understand how to:
✅ Define x and y ranges
✅ Use meshgrid to create a grid
✅ Calculate z values for the surface
✅ Plot the surface using surf
✅ Add axis labels and a title
✅ A colorbar to make the plot more informative (optional)
💡 MATLAB makes visualization simple and powerful. By the end of this video, you’ll be able to create and customize your own 3D plots with ease.
📂 Topics Covered:
What is MATLAB
Creating x and y ranges
Using meshgrid
Defining z = sin(x)*cos(y)
Plotting with surf
Adding axis labels & title
A color bar for better visualization (optional)
🚀 Code Used in This Video:
x = -3*pi : 0.1 : 3*pi;
y = -3*pi : 0.1 : 3*pi;
[x, y] = meshgrid(x, y);
z = sin(x) .* cos(y);
surf(x, y, z)
xlabel('x-axis')
ylabel('y-axis')
zlabel('z-axis')
title('Plot the surface z = sin(x).cos(y)')
📚 Keywords:
MATLAB Tutorial, 3D Surface Plot MATLAB, surf command, meshgrid MATLAB, sin cos function plot, MATLAB for beginners, engineering visualization, MATLAB 3D graph, MATLAB plotting tutorial
#matlab #matlabbasicsbook #surface #plot #engineering #visualization #programming #tutorial #colorbar #datavisualization #mathematics #iem #iemkolkata