?? ch4_1_1.htm
字號(hào):
<! Made by Html Translation Ver 1.0>
<HTML>
<HEAD>
<TITLE> 常見數(shù)學(xué)函數(shù) </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 常見數(shù)學(xué)函數(shù)</H1>
</FONT>
<HR>
<P>
我們在第二章已介紹了加、減、乘、除等簡易的代數(shù)運(yùn)算,除此之外MATLAB還提供許多內(nèi)建函數(shù),如對(duì)數(shù)
函數(shù)、三角函數(shù)、多項(xiàng)式函數(shù)等,方便我們計(jì)算。舉例來說,要計(jì)算一角度的sine值,過程如下:
<P>
<FONT COLOR=#FF0000>>> angle1=pi/2;</FONT>
<P>
<FONT COLOR=#FF0000>>> b=sin(angle1); %注意angle1為徑度,sin函數(shù)計(jì)算值需以徑度表示</FONT>
<P>
<FONT COLOR=#FF0000>>> angle2=90; %注意angle2為角度</FONT>
<P>
<FONT COLOR=#FF0000>>> b=sin(angle2*pi/180); %也可在函數(shù)內(nèi)作角度與徑度轉(zhuǎn)換
</FONT>
<P>
<FONT COLOR=#FF0000>>> x=sqrt(2)/2; y=asin(x); y_deg=y*180/pi</FONT>
<P>
<FONT COLOR=#FF0000>>> x =</FONT>
<P>
<FONT COLOR=#FF0000>0.7071</FONT>
<P>
<FONT COLOR=#FF0000>>> y =</FONT>
<P>
<FONT COLOR=#FF0000>0.7854</FONT>
<P>
<FONT COLOR=#FF0000>>> y_deg =</FONT>
<P>
<FONT COLOR=#FF0000>45.0000<BR>
</FONT>
<P>
使用函數(shù)須注意幾點(diǎn)。首先函數(shù)一定出現(xiàn)在計(jì)算等式的右邊,等式左邊是代表這個(gè)函數(shù)的計(jì)算值。此外,一
個(gè)函數(shù)可以被當(dāng)做另一個(gè)函數(shù)的引數(shù)(argument)。例如:<FONT COLOR=#FF0000>log_x=log(abs(x))</FONT>其中<FONT COLOR=#FF0000>abs</FONT>和<FONT COLOR=#FF0000>log</FONT>皆為內(nèi)建函數(shù),其意思是
先計(jì)算abs(x),所得值再代入log函數(shù)。
<BR>
<P>
指令 意義
<P>
<FONT COLOR=#FF0000>round(x)</FONT> 將<FONT COLOR=#FF0000>x</FONT>值進(jìn)位至最接近的整數(shù)
<P>
<FONT COLOR=#FF0000>fix(x)</FONT> 將<FONT COLOR=#FF0000>x</FONT>值進(jìn)位至最接近0的整數(shù)
<P>
<FONT COLOR=#FF0000>floor(x)</FONT> 將<FONT COLOR=#FF0000>x</FONT>值進(jìn)位至最接近<FONT SIZE=5>-</FONT>∞的整數(shù)
<P>
<FONT COLOR=#FF0000>ceil(x)</FONT> 將<FONT COLOR=#FF0000>x</FONT>值進(jìn)位至最接近∞的整數(shù)
<P>
<FONT COLOR=#FF0000>sign(x)</FONT> 如果<FONT COLOR=#FF0000>x</FONT>
<0傳回值為-1,如果<FONT COLOR=#FF0000>x</FONT> =0傳回值為0,如果<FONT COLOR=#FF0000>x</FONT>
>0傳回值為 1
<P>
<FONT COLOR=#FF0000>rem(x,y)</FONT> 傳回x/y的余數(shù),例如<FONT COLOR=#FF0000>rem(25,4)</FONT>的值為1
<P>
<FONT COLOR=#FF0000>exp(x)</FONT> 指數(shù)函數(shù)
<P>
<FONT COLOR=#FF0000>log(x)</FONT> 以e <FONT FACE="細(xì)明體">2.718282</FONT>為底的對(duì)數(shù)函數(shù),及自然對(duì)數(shù)
<P>
<FONT COLOR=#FF0000>log10(x)</FONT> 為10底的對(duì)數(shù)函數(shù)<BR>
<P>
其余的內(nèi)建函數(shù),用法可以參考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>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -