How do I plot 3-dimentional graph of the following function? Can Plot3 function do this?
2 次查看(过去 30 天)
显示 更早的评论
fun=@(x,y)100*(y-x^2)^2+(1-x)^2;
采纳的回答
Walter Roberson
2015-10-9
fun = @(x,y)100*(y-x.^2).^2 + (1-x).^2;
x = linspace(-10,10);
y = linspace(-50,-30);
plot3d(x, y, fun(x,y))
3 个评论
Steven Lord
2015-10-9
Your function is defined in such a way that you can pass x and y matrices, not just vectors or scalars, into it. Because of that take a look at the MESHGRID function to generate the data points at which you evaluate and plot your function.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!