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

18 次查看(过去 30 天)
MathWorks Support Team
関数ワークスペースの変数をベースワークスペース上で使用したいのですが、どうすればよいですか?

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 変数 的更多信息

Community Treasure Hunt

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

Start Hunting!