資源描述:
《《基本矩陣運(yùn)算》PPT課件》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、第二章基本矩陣運(yùn)算1簡單矩陣輸入命令行簡單鍵盤輸入用于很少數(shù)據(jù)輸入矩陣的方向:,;NaNInf文件形式輸入:importdata(.xls文件,.txt文件)可以用來讀入試驗(yàn)數(shù)據(jù)海量的數(shù)據(jù)輸入load數(shù)據(jù)文本文件:全部是數(shù)據(jù)mat文件:matlab自有的數(shù)據(jù)格式Evaluationonly.CreatedwithAspose.Slidesfor.NET3.5ClientProfile5.2.0.0.Copyright2004-2011AsposePtyLtd.Matlab程序設(shè)計(jì)教程12語句生成矩陣線性等間距格式矩陣,使用from:step:tolin
2、space命令a=linspace(1,10,5);矩陣連接c=[ab];zerosoneseyerandn[]Evaluationonly.CreatedwithAspose.Slidesfor.NET3.5ClientProfile5.2.0.0.Copyright2004-2011AsposePtyLtd.Matlab程序設(shè)計(jì)教程23導(dǎo)入特殊的文件格式導(dǎo)入向?qū)В篿mportwizard可以導(dǎo)入的文件格式:文本文件:.txt.dat圖片文件:.gif.bmp.jpg.avi聲音:.wav.au電子表格:.csv.xls.wk1更加復(fù)雜的自定義數(shù)據(jù)需
3、要編程導(dǎo)入:excel文件讀取函數(shù)(xlswrite,xlsread,速度較慢)Evaluationonly.CreatedwithAspose.Slidesfor.NET3.5ClientProfile5.2.0.0.Copyright2004-2011AsposePtyLtd.Matlab程序設(shè)計(jì)教程3讀入特殊格式文件:文本類型Evaluationonly.CreatedwithAspose.Slidesfor.NET3.5ClientProfile5.2.0.0.Copyright2004-2011AsposePtyLtd.Matlab程序設(shè)計(jì)教
4、程4讀入特殊格式文件:二進(jìn)格式Evaluationonly.CreatedwithAspose.Slidesfor.NET3.5ClientProfile5.2.0.0.Copyright2004-2011AsposePtyLtd.Matlab程序設(shè)計(jì)教程54矩陣運(yùn)算矩陣的轉(zhuǎn)置用符號(hào)’來表示和實(shí)現(xiàn)非共軛轉(zhuǎn)置.’矩陣的四則運(yùn)算+-*/點(diǎn)乘:.*右除:./左除:.矩陣的乘方^矩陣乘方.^元素對(duì)元素的乘方矩陣的范數(shù)norm1-范數(shù)2-范數(shù)–無窮范數(shù)條件數(shù)condEvaluationonly.CreatedwithAspose.Slidesfor.NET3
5、.5ClientProfile5.2.0.0.Copyright2004-2011AsposePtyLtd.Matlab程序設(shè)計(jì)教程65矩陣的初等函數(shù)MATLAB中exp、sprt、sin、cos等命令可以直接使用在矩陣上,這種運(yùn)算只是定義在矩陣的單個(gè)元素上,即分別對(duì)矩陣的每個(gè)元素進(jìn)行運(yùn)算。MATLAB中也提供了基本的三角函數(shù)。函數(shù)名含義abs絕對(duì)值或者復(fù)數(shù)模sqrt平方根real實(shí)部imag虛部conj復(fù)數(shù)共軛round4舍5入到整數(shù)fix舍入到最接近0的整數(shù)floor舍入到最接近-∞的整數(shù)ceil舍入到最接近∞的整數(shù)Evaluationonly.C
6、reatedwithAspose.Slidesfor.NET3.5ClientProfile5.2.0.0.Copyright2004-2011AsposePtyLtd.Matlab程序設(shè)計(jì)教程75矩陣的初等函數(shù)函數(shù)名含義sign符號(hào)函數(shù)rem留數(shù)sin正弦cos余弦tan正切asin反正弦acos反余弦atan反正切atan2第四象限反正切函數(shù)名含義sinh雙曲正弦cosh雙曲余弦tanh雙曲正切exp自然指數(shù)log自然對(duì)數(shù)log10以10為底的對(duì)數(shù)bessel貝賽爾函數(shù)gamma伽嗎函數(shù)rat有理逼近Evaluationonly.Createdwi
7、thAspose.Slidesfor.NET3.5ClientProfile5.2.0.0.Copyright2004-2011AsposePtyLtd.Matlab程序設(shè)計(jì)教程8指數(shù)和對(duì)數(shù)函數(shù)exp指數(shù)函數(shù)exp函數(shù)是面向陣列元素的操作。例如:X=[1 2;-1-2];Y=exp(x)log自然對(duì)數(shù)例如:X=[21;-1-2];Y=log(X)Evaluationonly.CreatedwithAspose.Slidesfor.NET3.5ClientProfile5.2.0.0.Copyright2004-2011AsposePtyLtd.Matl
8、ab程序設(shè)計(jì)教程9復(fù)數(shù)函數(shù)abs絕對(duì)值和復(fù)數(shù)模angle相角。P=angle(Z)可得復(fù)數(shù)Z的