Plotting two functions on 3D surface for the same interval

7 views (last 30 days)
Hello
I have two functions, say
Z1=x^2
Z2=x^3
x: 0:10
How i can create a 3D surface plot
thanks in advance

Accepted Answer

Star Strider
Star Strider on 24 Jan 2020
Try this:
x = 0:10;
Z1=x.^2;
Z2=x.^3;
figure
surf(Z1.'*Z2)
Another possibility:
figure
surf([Z1; Z2])
It is not certain what you want.
  4 Comments
Star Strider
Star Strider on 25 Jan 2020
Fuad Nammas’s Answer moved here —
why is the scale on the x-axis on the plot does not fit the given interval x:0:10

Sign in to comment.

More Answers (3)

Fuad Nammas
Fuad Nammas on 25 Jan 2020
sooooo many thanks dear Star Strider
it works now
thanks with appreciation
you are super hero

Fuad Nammas
Fuad Nammas on 25 Jan 2020
Dear Star Strider
one last question..
How i can give a different color for each function
i mean
color for Z1 and another color for Z2
i will be greatfull for you
regards
  1 Comment
Star Strider
Star Strider on 25 Jan 2020
That is not possible as you have defined the plot.
The ‘x’ and ‘Z1’ vectors define the axes, so only ‘Z2’ can have color associated with the surface plot.

Sign in to comment.


Fuad Nammas
Fuad Nammas on 25 Jan 2020
many thanks Mr.Strider
God Bless you

Categories

Find more on Graphics Object Properties 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!