使用^输入时出错必须是标量和方阵

时间:2013-09-06 12:51:21

标签: matlab

我在运行此代码时出现问题,这给了我这个错误

  

使用^输入时出错必须是标量和方阵。至   计算elementwise POWER,改用POWER(。^)。

     

cal_path出错(第149行)   F = Z-(2 *(1 + SQRT(1-CX ^ 2 * Y ^ 2))*(CX * X ^ 2 +赛扬* Y ^ 2)* -Cx赛扬^ 2 *(X ^ 2 + Y ^ 2)* Y ^ 2)./(1个+ SQRT(1-CX ^ 2 * Y ^ 2))*((1个+ SQRT(1-CX ^ 2 * Y ^ 2))...

这是我的代码

 Cx=1/25;              
 Cy=1/10

 syms x y z
 f=z-(2*(1+sqrt(1-Cx^2*y^2))*(Cx*x^2+Cy*y^2)-Cx*Cy^2*(x^2+y^2)*y^2)./(1+sqrt(1- Cx^2*y^2))*((1+sqrt(1-Cx^2*y^2))+sqrt((1+sqrt(1-Cx^2*y^2))^2-Cx*(2*1+sqrt(1-Cx^2*y^2)*(Cx*x^2+Cy*y^2)-Cx*Cy^2*(x^2+y^2)*y^2)));
 %the function of the surface F(x,y,z)=0%

 diff(f,x); % calculate the differential of x
 diff(f,y); % calculate the differential of y
 diff(f,z); % calculate the differential of z

0 个答案:

没有答案