⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch4_1_1.htm

📁 matlab详细手册,提供各种相关的操作
💻 HTM
字号:
<! Made by Html Translation Ver 1.0>

<HTML>

<HEAD>

<TITLE> 常见数学函数 </TITLE>

</HEAD>



<BODY BACKGROUND="bg0000.gif" tppabs="http://166.111.167.223/computer/cai/matlabjc/img/bg0000.gif">

<FONT COLOR="#0000FF">

<H1>4.1.1 常见数学函数</H1>

</FONT>

<HR>



<P>

我们在第二章已介绍了加、减、乘、除等简易的代数运算,除此之外MATLAB还提供许多内建函数,如对数

函数、三角函数、多项式函数等,方便我们计算。举例来说,要计算一角度的sine值,过程如下:

<P>

<FONT COLOR=#FF0000>&gt;&gt; angle1=pi/2;</FONT>

<P>

<FONT COLOR=#FF0000>&gt;&gt; b=sin(angle1);    %注意angle1为径度,sin函数计算值需以径度表示</FONT>

<P>

<FONT COLOR=#FF0000>&gt;&gt; angle2=90;     %注意angle2为角度</FONT>

<P>

<FONT COLOR=#FF0000>&gt;&gt; b=sin(angle2*pi/180);  %也可在函数内作角度与径度转换

</FONT>

<P>

<FONT COLOR=#FF0000>&gt;&gt; x=sqrt(2)/2; y=asin(x); y_deg=y*180/pi</FONT>

<P>

<FONT COLOR=#FF0000>&gt;&gt; x =</FONT>

<P>

<FONT COLOR=#FF0000>0.7071</FONT>

<P>

<FONT COLOR=#FF0000>&gt;&gt; y =</FONT>

<P>

<FONT COLOR=#FF0000>0.7854</FONT>

<P>

<FONT COLOR=#FF0000>&gt;&gt; y_deg =</FONT>

<P>

<FONT COLOR=#FF0000>45.0000<BR>

</FONT>

<P>

使用函数须注意几点。首先函数一定出现在计算等式的右边,等式左边是代表这个函数的计算值。此外,一

个函数可以被当做另一个函数的引数(argument)。例如:<FONT COLOR=#FF0000>log_x=log(abs(x))</FONT>其中<FONT COLOR=#FF0000>abs</FONT>和<FONT COLOR=#FF0000>log</FONT>皆为内建函数,其意思是

先计算abs(x),所得值再代入log函数。

<BR>

<P>

指令  意义

<P>

<FONT COLOR=#FF0000>round(x)</FONT>   将<FONT COLOR=#FF0000>x</FONT>值进位至最接近的整数

<P>

<FONT COLOR=#FF0000>fix(x)</FONT>   将<FONT COLOR=#FF0000>x</FONT>值进位至最接近0的整数

<P>

<FONT COLOR=#FF0000>floor(x)</FONT>   将<FONT COLOR=#FF0000>x</FONT>值进位至最接近<FONT SIZE=5>-</FONT>∞的整数

<P>

<FONT COLOR=#FF0000>ceil(x)</FONT>   将<FONT COLOR=#FF0000>x</FONT>值进位至最接近∞的整数

<P>

<FONT COLOR=#FF0000>sign(x)</FONT>   如果<FONT COLOR=#FF0000>x</FONT>

&lt;0传回值为-1,如果<FONT COLOR=#FF0000>x</FONT> =0传回值为0,如果<FONT COLOR=#FF0000>x</FONT>

&gt;0传回值为 1

<P>

<FONT COLOR=#FF0000>rem(x,y)</FONT>   传回x/y的余数,例如<FONT COLOR=#FF0000>rem(25,4)</FONT>的值为1

<P>

<FONT COLOR=#FF0000>exp(x)</FONT>  指数函数

<P>

<FONT COLOR=#FF0000>log(x)</FONT>   以e <FONT FACE="细明体">2.718282</FONT>为底的对数函数,及自然对数

<P>

<FONT COLOR=#FF0000>log10(x)</FONT>  为10底的对数函数<BR>

<P>

其余的内建函数,用法可以参考MATLAB的线上说明或使用手册。<BR><HR>

<A HREF="javascript:if(confirm('http://166.111.167.223/computer/tppmsgs/msgs0.htm  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://166.111.167.223/computer/tppmsgs/msgs0.htm#90'" tppabs="http://166.111.167.223/computer/tppmsgs/msgs0.htm#90"><IMG SRC="lastpage.gif" tppabs="http://166.111.167.223/computer/cai/matlabjc/img/lastpage.gif" BORDER=0></A>

<A HREF="ch4_1_2.htm" tppabs="http://166.111.167.223/computer/cai/matlabjc/ch4_1_2.htm"><IMG SRC="nextpage-1.gif" tppabs="http://166.111.167.223/computer/cai/matlabjc/img/nextpage.gif" BORDER=0 HSPACE=10></A>

<A HREF="index.html" tppabs="http://166.111.167.223/computer/cai/matlabjc/index.html"><IMG SRC="outline-1.gif" tppabs="http://166.111.167.223/computer/cai/matlabjc/img/outline.gif" BORDER=0 HSPACE=6></A><BR>

<FONT SIZE=2 COLOR=#AA55FF> 上一页 下一页 讲义大纲 </FONT>

</BODY>

</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -