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

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

 Risposta accettata

Atsushi Ueno
Atsushi Ueno il 20 Lug 2024
Spostato: Atsushi Ueno il 20 Lug 2024

0 voti

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

1 Commento

松
il 25 Lug 2024
ありがとうございます.

Accedi per commentare.

Più risposte (0)

Categorie

Prodotti

Release

R2024a

Tag

Richiesto:

松
il 20 Lug 2024

Commentato:

松
il 25 Lug 2024

Community Treasure Hunt

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

Start Hunting!