一、数值运算 1

使用 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

【MATLAB】数值运算 ( 数值运算示例 | 三角函数 | 指数运算 | 对数运算 | 常用的数学公式对应函数 )_指数

【MATLAB】数值运算 ( 数值运算示例 | 三角函数 | 指数运算 | 对数运算 | 常用的数学公式对应函数 )_matlab_02





二、数值运算 2

计算如下公式 :

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】数值运算 ( 数值运算示例 | 三角函数 | 指数运算 | 对数运算 | 常用的数学公式对应函数 )_三角函数_03


上述公式对应的 matlab 代码如下 :

sin( sqrt(pi) ) + log( tan(1) )

执行结果 :

>> Untitled

ans =

    1.4228

【MATLAB】数值运算 ( 数值运算示例 | 三角函数 | 指数运算 | 对数运算 | 常用的数学公式对应函数 )_对数_04





三、常用的数学公式对应函数

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