12.07.2015 Views

Matlab/Octave Tutorial

Matlab/Octave Tutorial

Matlab/Octave Tutorial

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

MATLAB 程 式 設 計 入 門 篇 : 初 探 MATLAB全 域 變 數 的 使 用 (II)• Func6.m 沒 有 輸 出 和 輸 入 , 只 宣 告 全 域 變 數 X,將 X 的 值 加 2, 並 印 出 其 值• 測 試>> global X % 在 基 本 工 作 空 間 進 行 全 域 變 數 x 的 宣 告>> X = 2;>> fprintf('The value of X in the base workspace is %g.\n', X);The value of X in the base workspace is 2.>> func6;The value of X in "func6" is 4.>> fprintf('The value of X in the base workspace is %g.\n', X);The value of X in the base workspace is 4.120

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!