(translator=pacific, ChineseSource=pacific-20020530-8\script.html, EnglishSource=c:\matlabr12\help\techdoc\ref\script.html)
MATLAB Function Reference    
script

將M檔案副本化(Script M-files)

Description

副本檔(script file)是包括MATLAB指令的外部檔案 (external file)。 By typing the filename, subsequent MATLAB input is obtained from the file. 有延伸檔名為 .m 的副本檔通常叫做M檔案。

副本檔是最簡單的M檔案。若要將MATLAB的命令做區隔,副本是很好用的。例如在命令列中重覆執行運算。( They are useful for automating blocks of MATLAB commands, such as computations you have to perform repeatedly from the command line.) 副本也可以對既有的資料進行運算,也可以產生新的資料。雖然副本不會傳值回來,但是仍然可以利用它來在工作欄(workspace)產生變數以便將來做運算。另外,副本可以使用像plot 的指令來產生圖表。

副本可以包含任何MATLAB指令。而且不需要宣告或begin/end指令。

副本和其他M檔案一樣也能有註解。而在百分比符號後(%)的文字就是註解。註解可以為一整行,或是放在可執行指令的後面。

See Also
echo        Echo M-files during execution

function    將M檔案函式化(Function M-files)

type        列出檔案相關資料(List file)


 schur sec, sech