How to plot3D with inverse of matrix involved?
1 次查看(过去 30 天)
显示 更早的评论
I don't know what is worng with my code. Can someone figure this out? I plotted it on Wolfram Alpha and it's diffrent in MATLAB! The code is in the picture attached.
0 个评论
回答(1 个)
Steven Lord
2019-11-14
Look at the X and Y limits on your MATLAB plot, then look at the X and Y limits on the plot from Wolfram Alpha.
MATLAB is giving you (a small section of) the same plot as Wolfram Alpha. Adjust your meshgrid call.
And FYI, instead of computing 2 * (denominator).^(-1) you could just use 2./denominator. That looks a little more like the original equation, doesn't it?
Once you have the adjusted plot, to prove to yourself that MATLAB got it right originally set the axes limits for the adjusted plot to the values they had in the plot in your screenshot above and compare with that screenshot.
axis([-2 2 -2 2 0 0.2])
They look pretty similar. Then restore the limits to their automatically chosen values to see the whole surface.
axis auto
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!