エディターの値をMA​TLABfuncti​onで使用する方法

simcapeで作成したモデルを画像のようにコマンドから解析を実行するプログラムを作成しました.そのときに画像の「i」の値をsimscapeモデル内のMATLABFunctionに渡して解析に使用したいのですが,何か方法はありますでしょうか.
画像はMATLABのエディターで作成したプログラムになっています.

 Accepted Answer

Atsushi Ueno
Atsushi Ueno on 20 Jul 2024
Moved: Atsushi Ueno on 20 Jul 2024
  • 方法②:MATLABの evalin 関数でベースワークスペースの変数 i を MATLAB function 内に取り込む
function myout = myfcn(myvar)
myout = evalin('base','i');
end

1 Comment

松
on 25 Jul 2024
ありがとうございます.

Sign in to comment.

More Answers (0)

Categories

Products

Release

R2024a

Tags

Asked:

松
on 20 Jul 2024

Commented:

松
on 25 Jul 2024

Community Treasure Hunt

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

Start Hunting!