How I plot 3d graph of known x,y,z ?

1 view (last 30 days)
rumpa dasgupta
rumpa dasgupta on 3 Aug 2015
Commented: rumpa dasgupta on 3 Aug 2015
I have known x,y,z and I want to plot them in 3d graph, please how can I do that? The data is attached for your reference ..
Thanks in advance,
x = [2 4 6 8 10];
y = [1 2 3 4 5];
Number of Y
z= Number [2220.6 0 0 0 0;
of
x 1160.4 1106.3 0 0 0;
806.9 0 734.86 0 0;
630.2 576.1 0 549.1438 0;
524.2 0 0 0 436.4909];
xlabel('Number of X ');
ylabel('Number of Y');
zlabel('Function (X , Y)')

Answers (1)

Azzi Abdelmalek
Azzi Abdelmalek on 3 Aug 2015
Edited: Azzi Abdelmalek on 3 Aug 2015
z= [ 2220.6 0 0 0 0
1160.4 1106.3 0 0 0
806.9 0 734.86 0 0
630.2 576.1 0 549.1438 0
524.2 0 0 0 436.4909]
x = [2 4 6 8 10];
y = [1 2 3 4 5];
[X,Y]=meshgrid(x,y)
mesh(X,Y,z)
or
surf(X,Y,z)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!