Clear Filters
Clear Filters

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

27 views (last 30 days)
松
on 20 Jul 2024 at 6:45
Commented: on 25 Jul 2024 at 1:24
simcapeで作成したモデルを画像のようにコマンドから解析を実行するプログラムを作成しました.そのときに画像の「i」の値をsimscapeモデル内のMATLABFunctionに渡して解析に使用したいのですが,何か方法はありますでしょうか.
画像はMATLABのエディターで作成したプログラムになっています.

Accepted Answer

Atsushi Ueno
Atsushi Ueno on 20 Jul 2024 at 8:13
Moved: Atsushi Ueno on 20 Jul 2024 at 8:14
  • 方法②:MATLABの evalin 関数でベースワークスペースの変数 i を MATLAB function 内に取り込む
function myout = myfcn(myvar)
myout = evalin('base','i');
end
  1 Comment
松
on 25 Jul 2024 at 1:24
ありがとうございます.

Sign in to comment.

More Answers (0)

Categories

Find more on 一般分野への適用 in Help Center and File Exchange

Tags

Products


Release

R2024a

Community Treasure Hunt

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

Start Hunting!