Implement mupad Codes into Matlab Script

Can anyone help me to implement the following mupad codes into matlab script so that I can directly save the result into the working space?
l1 := 0.167;
l2 := 1.136037;
THETA:= -2.0;
argu:=sqrt(k)*l1;
num := 1/sqrt(k)*sin(argu)+l2*cos(argu);
den := -l2*sqrt(k)*sin(argu)+cos(argu);
F:=-THETA+arctan(num/den)
numeric::fsolve(F, [k=-40..40], MultiSolutions);
Thanks a lot!

 採用された回答

Walter Roberson
Walter Roberson 2015 年 8 月 12 日

0 投票

l1 = 0.167;
l2 = 1.136037;
THETA = -2.0;
syms k
argu = sqrt(k)*l1;
num = 1/sqrt(k)*sin(argu)+l2*cos(argu);
den = -l2*sqrt(k)*sin(argu)+cos(argu);
F = -THETA+arctan(num/den);
vpasolve(F, k, [-40,40])
However, there are no real-valued solutions to that equation.

1 件のコメント

Karry Li
Karry Li 2015 年 8 月 12 日
Thanks a lot. Only one question: how do you come up with vpasolve instead of fzero and fsolve?

サインインしてコメントする。

その他の回答 (0 件)

質問済み:

2015 年 8 月 11 日

コメント済み:

2015 年 8 月 12 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by