
2d function in 3d
2 views (last 30 days)
Show older comments
felix jose chavez torres
on 25 Jan 2018
Commented: Star Strider
on 26 Jan 2018
i need to show this function y = x^2 in 3d in matlab

0 Comments
Accepted Answer
Star Strider
on 26 Jan 2018
Edited: Star Strider
on 26 Jan 2018
Try this:
x = [1;1] * linspace(-4, 4, 25) ;
y = x.^2;
figure(1)
surf(x, y, [zeros(size(x(1,:))); 5*ones(size(x(1,:)))], 'EdgeColor','b')
grid on
view(-75, 45)

EDIT — Added plot.
2 Comments
More Answers (1)
See Also
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!