How to plot this function?

1 次查看(过去 30 天)
Mel
Mel 2011-3-14
Hi Im a beginner and tried plotting the following function, Z, but it does not seem to work. Can anyone help me?
x=0:10:200;
y=0:0.05:1;
[X,Y]=meshgrid(x,y);
Z=(-0.5)*x.*(x+1)*(x-1)*((y.^x./x)-(2*(y.^(x-1))./(x-1))+(y.^(x-2))/(x-2)-2/(x.*(x-1)*(x-2)));
surf(X,Y,Z)

采纳的回答

Matt Fig
Matt Fig 2011-3-14
Try this instead:
x=0:10:200;
y=0:0.05:1;
[X,Y]=meshgrid(x,y);
Z=(-0.5)*X.*(X+1).*(X-1).*((Y.^X./X)-(2*(Y.^(X-1))./(X-1))+(Y.^(X-2))./(X-2)-2./(X.*(X-1).*(X-2)));
surf(X,Y,Z)
rotate3d on

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by