简体   繁体   English

Matlab 3D图平方?

[英]Matlab 3D plot quadratic?

How to plot a 3d graph of a quadratic funciton. 如何绘制二次函数的3d图。 Here is my code for the 2D plot is there anyway to adapt it for a 3d code ? 这是我的2D图代码,无论如何都可以使其适应3D代码?

z = (startv2:step:endv2);
y = (a2.*(z.^2))+(b2.*z)+c2;
plot(z,y);
text(value1,0, ['X1 = ',num2str(value1),' ']);
text(value2,0, ['X2 = ',num2str(value2)]);
grid

These MATLAB functions might help: 这些MATLAB函数可能会有所帮助:

plot3

or 要么

contour3

or 要么

surf

depending on what you want to show. 取决于您要显示的内容。 The MATLAB help (click on the functions above) has examples for all of them. MATLAB帮助(单击上面的函数)提供了所有示例的示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM