plot a function in 3D
2 次查看(过去 30 天)
显示 更早的评论
I have variables a and b both defined in [-1,+1] and the function c = a / (a + b)
How can I plot c in 3D to visualize the function?
0 个评论
采纳的回答
Walter Roberson
2011-8-13
RESOLUTION=20; %increase this for a finer grid
t = linspace(-1,1,RESOLUTION);
[a,b] = ndgrid(t,t);
c = a./(a+b);
surf(a,b,c);
It is, however, not possible to plot it as a continuous surface, as your graphics display only has discretized output locations ("pixels").
3 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!