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

您所在的位置:网站首页 指数运算常用公式 【MATLAB】数值运算 ( 数值运算示例

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

2024-07-05 08:48| 来源: 网络整理| 查看: 265

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

使用 matlab 计算如下公式 :

\cos \bigg(\sqrt{ \cfrac{(1 + 2 + 3 + 4) ^3}{5} }\bigg)

在 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代码语言:javascript复制// 方式一 : cos(sqrt((1 + 2 + 3 + 4)^3/5))代码语言:javascript复制// 方式二 : cos(((1 + 2 + 3 + 4)^3/5)^0.5)

执行结果 :

代码语言:javascript复制>> Untitled ans = -0.0050在这里插入图片描述在这里插入图片描述在这里插入图片描述在这里插入图片描述二、数值运算 2

计算如下公式 :

\sin(\sqrt{\pi}) + \ln (\tan (1))\ln x

\log_ex

函数 , 求

x

的自然对数 , 是

e^x

的反函数 ;

涉及到的函数 :

平方根 : https://ww2.mathworks.cn/help/matlab/ref/sqrt.html\sin

函数 : https://ww2.mathworks.cn/help/matlab/ref/sin.html

\tan

函数 : https://ww2.mathworks.cn/help/matlab/ref/tan.html

\log

函数 ( 自然对数 ) : https://ww2.mathworks.cn/help/matlab/ref/log.html

常用的常量和测试矩阵 : https://ww2.mathworks.cn/help/matlab/constants-and-test-matrices.html , 在该文档中有 \pi

的表示方法 ;

其它

\log

函数 : 在 matlab 中 , log 函数表示以

e

为底的对数计算 ;

log10 表示以 10

为底的对数 : https://ww2.mathworks.cn/help/matlab/ref/log10.html

log2 表示以 2

为底的对数 : https://ww2.mathworks.cn/help/matlab/ref/log2.html

指数和对数运算参考 https://ww2.mathworks.cn/help/matlab/exponents-and-logarithms.html 页面 ;

在这里插入图片描述在这里插入图片描述

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

代码语言:javascript复制sin( sqrt(pi) ) + log( tan(1) )

执行结果 :

代码语言:javascript复制>> 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