【MATLAB】数值运算 ( 数值运算示例

您所在的位置:网站首页 怎么用matlab计算三角函数 【MATLAB】数值运算 ( 数值运算示例

【MATLAB】数值运算 ( 数值运算示例

2024-04-10 18:11| 来源: 网络整理| 查看: 265

文章目录 一、数值运算 1二、数值运算 2三、常用的数学公式对应函数

一、数值运算 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 中代码如下 :

平方根 : https://ww2.mathworks.cn/help/matlab/ref/sqrt.html幂运算 : https://ww2.mathworks.cn/help/matlab/ref/mpower.html余弦函数 : https://ww2.mathworks.cn/help/matlab/ref/double.cos.html // 方式一 : cos(sqrt((1 + 2 + 3 + 4)^3/5)) // 方式二 : cos(((1 + 2 + 3 + 4)^3/5)^0.5)

执行结果 :

>> Untitled ans = -0.0050

在这里插入图片描述

在这里插入图片描述

二、数值运算 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 loge​x 函数 , 求 x x x 的自然对数 , 是 e x e^x ex 的反函数 ;

涉及到的函数 :

平方根 : https://ww2.mathworks.cn/help/matlab/ref/sqrt.html sin ⁡ \sin sin 函数 : https://ww2.mathworks.cn/help/matlab/ref/sin.html tan ⁡ \tan tan 函数 : https://ww2.mathworks.cn/help/matlab/ref/tan.html log ⁡ \log log 函数 ( 自然对数 ) : https://ww2.mathworks.cn/help/matlab/ref/log.html常用的常量和测试矩阵 : https://ww2.mathworks.cn/help/matlab/constants-and-test-matrices.html , 在该文档中有 π \pi π 的表示方法 ;

其它 log ⁡ \log log 函数 : 在 matlab 中 , log 函数表示以 e e e 为底的对数计算 ;

log10 表示以 10 10 10 为底的对数 : https://ww2.mathworks.cn/help/matlab/ref/log10.htmllog2 表示以 2 2 2 为底的对数 : https://ww2.mathworks.cn/help/matlab/ref/log2.html

指数和对数运算参考 https://ww2.mathworks.cn/help/matlab/exponents-and-logarithms.html 页面 ; 在这里插入图片描述

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

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

执行结果 :

>> Untitled ans = 1.4228

在这里插入图片描述

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

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

算数运算 : https://ww2.mathworks.cn/help/matlab/arithmetic.html三角函数 : https://ww2.mathworks.cn/help/matlab/trigonometry.html指数与对数 : https://ww2.mathworks.cn/help/matlab/exponents-and-logarithms.html特殊函数 : https://ww2.mathworks.cn/help/matlab/special-functions.html离散数学 : https://ww2.mathworks.cn/help/matlab/discrete-math.html


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3