简体   繁体   English

如何在八度音阶中使用 ezplot plot 隐式 function?

[英]How to plot implicit function using ezplot in octave?

newTheta Vector is of size 4 newTheta 向量的大小为 4

  -6.3702
   0.5712
   0.2067
   0.3877

It can plot:它可以 plot:

ezplot("-6.3702 + 0.5712*x + 0.2067*y + 0.3877*x*y", [-10 10]);

见图

But the problem occurs when I pass values of newTheta vector into the equation.但是当我将 newTheta 向量的值传递给方程时,就会出现问题。
Octave can plot the following command:八度可以 plot 如下命令:

ezplot(@(x,y) newTheta(1) + newTheta(2)*x + newTheta(3)*y, [-10 10]);

见图

But does not plot this command:但是没有 plot 这个命令:

ezplot(@(x,y) newTheta(1) + newTheta(2)*x + newTheta(3)*y + newTheta(4)*x *y, [-10 10])

图表为空白

Consider using a dot, .* , when multiplying for vectorization because x and y are vectors.考虑在乘法向量化时使用点.* ,因为xy是向量。 This should work:这应该有效:

newTheta  = [-6.3702
   0.5712
   0.2067
   0.3877];

ezplot(@(x,y) newTheta(1) + newTheta(2)*x + newTheta(3)*y + newTheta(4)*x .*y, [-10 10])

在此处输入图像描述

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

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