使用 matlab 计算如下公式 :
cos ( ( 1 + 2 + 3 + 4 ) 3 5 ) \cos \bigg(\sqrt{ \cfrac{(1 + 2 + 3 + 4) ^3}{5} }\bigg) cos(5(1+2+3+4)3 )
在 matlab 中代码如下 :
// 方式一 :
cos(sqrt((1 + 2 + 3 + 4)^3/5))
// 方式二 :
cos(((1 + 2 + 3 + 4)^3/5)^0.5)
执行结果 :
>> Untitled
ans =
-0.0050


计算如下公式 :
sin ( π ) + ln ( tan ( 1 ) ) \sin(\sqrt{\pi}) + \ln (\tan (1)) sin(π )+ln(tan(1))
ln x \ln x lnx 是 log e x \log_ex logex 函数 , 求 x x x 的自然对数 , 是 e x e^x ex 的反函数 ;
涉及到的函数 :
其它 log \log log 函数 : 在 matlab 中 , log 函数表示以 e e e 为底的对数计算 ;
指数 和对数运算参考 https://ww2.mathworks.cn/help/matlab/exponents-and-logarithms.html 页面 ;
上述公式对应的 matlab 代码如下 :
sin( sqrt(pi) ) + log( tan(1) )
执行结果 :
>> Untitled
ans =
1.4228

常用的数学公式对应函数 :