新聞中心

EEPW首頁 > 模擬技術 > 設計應用 > Mathematica入門教程之Mathematica的基本語法特征

Mathematica入門教程之Mathematica的基本語法特征

作者: 時間:2011-11-02 來源:網(wǎng)絡 收藏
: 0px; PADDING-TOP: 0px" vAlign=top width="27%">

LinerSolve[A,B]

求解滿足AX=B的一個解,A為方陣

NullSpace[A]

求解方程組AX=0的基礎解系的向量表, A為方陣

例:已知A=Mathematica入門教程之Mathematica的基本語法特征Mathematica入門教程之Mathematica的基本語法特征,計算A的秩,計算AX=0的基礎解系.

In[1]:=Mathematica入門教程之Mathematica的基本語法特征In[2]:=Mathematica入門教程之Mathematica的基本語法特征

Out[2]:=Mathematica入門教程之Mathematica的基本語法特征(*顯然,A的秩是2*)

In[3]:=Mathematica入門教程之Mathematica的基本語法特征

Out[3]:=Mathematica入門教程之Mathematica的基本語法特征(*A的兩個線性無關解*)

 

.程序流程控制 

  循環(huán)語句有For[賦初值,循環(huán)條件,增量語句,語句塊]表示如果滿足循環(huán)條件,則執(zhí)行語句塊和增量語句,直到不滿足條件為止,While[test,block]表明如果滿足條件test則反復執(zhí)行語句塊block,否則跳出循環(huán),Do[block,{i,imin,imax,istep}]與前者功能是相同的。還有Goto[lab], Label[lab]提供了程序中無條件跳轉,Continue[]Break[]提供了繼續(xù)循環(huán)或跳出循環(huán)的控制,Catch[語句塊1]Throw[語句塊2]提供了運算中對異常情況的處理。另外,在程序中書寫注釋可以用一對"(* *)"括起來,注釋可以嵌套。

.其他

  1.使用幫助,的幫助文件提供了內核的基本用法的說明,十分詳細,可以參照學習。 

  2.你可以使用"?符號名""??符號名"來獲得關于該符號



評論


技術專區(qū)

關閉