latex命令
用latex()将结果转化为latex格式,在复制到latex编辑器中
安利个latex在线编辑器很好用https://latex.91maths.com/
ans(3,3)
ans =
(cos(theta2 + 747/250)*(cos(theta3 - 747/250)/(cos(theta4)*(cos(theta3 - 747/250)^2 + sin(theta3 - 747/250)^2)) - (sin(theta3 - 747/250)*sin(theta4))/(cos(theta4)^2*(cos(theta3 - 747/250)^2 + sin(theta3 - 747/250)^2))))/(cos(theta2 + 747/250)^2 + sin(theta2 + 747/250)^2) - (sin(theta2 + 747/250)*(sin(theta3 - 747/250)/(cos(theta4)*(cos(theta3 - 747/250)^2 + sin(theta3 - 747/250)^2)) + (cos(theta3 - 747/250)*sin(theta4))/(cos(theta4)^2*(cos(theta3 - 747/250)^2 + sin(theta3 - 747/250)^2))))/(cos(theta2 + 747/250)^2 + sin(theta2 + 747/250)^2)
>> latex(ans)
ans =
'\frac{\cos\left(\theta _{2}+\frac{747}{250}\right)\,\left(\frac{\cos\left(\theta _{3}-\frac{747}{250}\right)}{\cos\left(\theta _{4}\right)\,\left({\cos\left(\theta _{3}-\frac{747}{250}\right)}^2+{\sin\left(\theta _{3}-\frac{747}{250}\right)}^2\right)}-\frac{\sin\left(\theta _{3}-\frac{747}{250}\right)\,\sin\left(\theta _{4}\right)}{{\cos\left(\theta _{4}\right)}^2\,\left({\cos\left(\theta _{3}-\frac{747}{250}\right)}^2+{\sin\left(\theta _{3}-\frac{747}{250}\right)}^2\right)}\right)}{{\cos\left(\theta _{2}+\frac{747}{250}\right)}^2+{\sin\left(\theta _{2}+\frac{747}{250}\right)}^2}-\frac{\sin\left(\theta _{2}+\frac{747}{250}\right)\,\left(\frac{\sin\left(\theta _{3}-\frac{747}{250}\right)}{\cos\left(\theta _{4}\right)\,\left({\cos\left(\theta _{3}-\frac{747}{250}\right)}^2+{\sin\left(\theta _{3}-\frac{747}{250}\right)}^2\right)}+\frac{\cos\left(\theta _{3}-\frac{747}{250}\right)\,\sin\left(\theta _{4}\right)}{{\cos\left(\theta _{4}\right)}^2\,\left({\cos\left(\theta _{3}-\frac{747}{250}\right)}^2+{\sin\left(\theta _{3}-\frac{747}{250}\right)}^2\right)}\right)}{{\cos\left(\theta _{2}+\frac{747}{250}\right)}^2+{\sin\left(\theta _{2}+\frac{747}{250}\right)}^2}'
cos
(
θ
2
+
747
250
)
(
cos
(
θ
3
−
747
250
)
cos
(
θ
4
)
(
cos
(
θ
3
−
747
250
)
2
+
sin
(
θ
3
−
747
250
)
2
)
−
sin
(
θ
3
−
747
250
)
sin
(
θ
4
)
cos
(
θ
4
)
2
(
cos
(
θ
3
−
747
250
)
2
+
sin
(
θ
3
−
747
250
)
2
)
)
cos
(
θ
2
+
747
250
)
2
+
sin
(
θ
2
+
747
250
)
2
−
sin
(
θ
2
+
747
250
)
(
sin
(
θ
3
−
747
250
)
cos
(
θ
4
)
(
cos
(
θ
3
−
747
250
)
2
+
sin
(
θ
3
−
747
250
)
2
)
+
cos
(
θ
3
−
747
250
)
sin
(
θ
4
)
cos
(
θ
4
)
2
(
cos
(
θ
3
−
747
250
)
2
+
sin
(
θ
3
−
747
250
)
2
)
)
cos
(
θ
2
+
747
250
)
2
+
sin
(
θ
2
+
747
250
)
2
\frac{\cos\left(\theta _{2}+\frac{747}{250}\right)\,\left(\frac{\cos\left(\theta _{3}-\frac{747}{250}\right)}{\cos\left(\theta _{4}\right)\,\left({\cos\left(\theta _{3}-\frac{747}{250}\right)}^2+{\sin\left(\theta _{3}-\frac{747}{250}\right)}^2\right)}-\frac{\sin\left(\theta _{3}-\frac{747}{250}\right)\,\sin\left(\theta _{4}\right)}{{\cos\left(\theta _{4}\right)}^2\,\left({\cos\left(\theta _{3}-\frac{747}{250}\right)}^2+{\sin\left(\theta _{3}-\frac{747}{250}\right)}^2\right)}\right)}{{\cos\left(\theta _{2}+\frac{747}{250}\right)}^2+{\sin\left(\theta _{2}+\frac{747}{250}\right)}^2}-\frac{\sin\left(\theta _{2}+\frac{747}{250}\right)\,\left(\frac{\sin\left(\theta _{3}-\frac{747}{250}\right)}{\cos\left(\theta _{4}\right)\,\left({\cos\left(\theta _{3}-\frac{747}{250}\right)}^2+{\sin\left(\theta _{3}-\frac{747}{250}\right)}^2\right)}+\frac{\cos\left(\theta _{3}-\frac{747}{250}\right)\,\sin\left(\theta _{4}\right)}{{\cos\left(\theta _{4}\right)}^2\,\left({\cos\left(\theta _{3}-\frac{747}{250}\right)}^2+{\sin\left(\theta _{3}-\frac{747}{250}\right)}^2\right)}\right)}{{\cos\left(\theta _{2}+\frac{747}{250}\right)}^2+{\sin\left(\theta _{2}+\frac{747}{250}\right)}^2}
cos(θ2+250747)2+sin(θ2+250747)2cos(θ2+250747)(cos(θ4)(cos(θ3−250747)2+sin(θ3−250747)2)cos(θ3−250747)−cos(θ4)2(cos(θ3−250747)2+sin(θ3−250747)2)sin(θ3−250747)sin(θ4))−cos(θ2+250747)2+sin(θ2+250747)2sin(θ2+250747)(cos(θ4)(cos(θ3−250747)2+sin(θ3−250747)2)sin(θ3−250747)+cos(θ4)2(cos(θ3−250747)2+sin(θ3−250747)2)cos(θ3−250747)sin(θ4))
pretty命令
>> simplify(ans)
ans =
cos(theta2 + theta3 + theta4)/cos(theta4)^2
>> pretty(ans)
cos(theta2 + theta3 + theta4)
-----------------------------
2
cos(theta4)
介绍两个公式推导化简常用命令
vpa(a,5)
将a中数值用小数表示,5表示保留几位有效数字。
simplify()
一键合并同类项化简公式