如何在Matlab中创建矩阵函数

问题描述 投票:0回答:1

I want to Implement the following trigonometric system of equations in MATLAB

enter image description here我应该为x1,x2 and x4写什么脚本解决?

matlab matrix trigonometry equation
1个回答
0
投票

您可以尝试在函数f中建立方程式系统,并使用fsolve来求解该系统,即

function y = f(x)
 y = zeros(3,1);
 y(1) =  cos(x(1)-x(2)-x(3)) - 0.707;
 y(2) =  5*cos(x(1)) + 3*cos(x(1)-x(2)) - 3;
 y(3) =  5*sin(x(1)) + 3*sin(x(1)-x(2)) - 4;
end

[x, fval, info] = fsolve (@f, [0;0;0])

诸如此类

x =

   1.5367
   1.8755
  -1.1244

fval =

  -0.000000014158
  -0.000000103868
  -0.000000551463

info =  1
© www.soinside.com 2019 - 2024. All rights reserved.