関数ワークスペースの​変数をベースワークス​ペース上で使用したい​のですが、どうすれば​よいですか?

22 Ansichten (letzte 30 Tage)
MathWorks Support Team
MathWorks Support Team am 24 Jan. 2013
関数ワークスペースの変数をベースワークスペース上で使用したいのですが、どうすればよいですか?

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 24 Jan. 2013
ASSIGNIN 関数を使用します。
次のように MATLAB ファンクションファイル内に記述すると、関数ワークスペース上の変数 x_local をベースワークスペース上の変数 x_base に割り当てることができます。
function myfun
x_local = magic(2);
assignin('base', 'x_base', x_local)

Weitere Antworten (0)

Kategorien

Mehr zu 変数 finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!