ヘルプ センターヘルプ センター
SimulationInput
クラス: sltest.TestCase 名前空間: sltest
MATLAB ベースの Simulink テストのモデルまたは Simulink.SimulationInput をシミュレート
Simulink.SimulationInput
R2020b 以降
simulate(testcase,model)
simulate(testcase,siminput)
simulate(testcase,Name,Value)
例
simout = simulate(testcase,model) は、指定されたモデルをシミュレートし、Simulink.SimulationOutput オブジェクトを返します。
simout
testcase
model
Simulink.SimulationOutput
simout = simulate(testcase,siminput) は、Simulink.SimulationInput オブジェクトを siminput として使用してシミュレートします。
siminput
simout = simulate(testcase,Name,Value) は、1 つ以上の Name,Value ペアの引数で指定された追加のオプションを使用してモデルをシミュレートします。
Name,Value
すべて展開する
testCase
sltest.TestCase
テスト ケースのインスタンス。sltest.TestCase オブジェクトとして指定します。
シミュレートするモデルのモデル拡張子を除く名前。スカラー string または文字ベクトルとして指定します。たとえば、myModel.slx モデルの場合は myModel のみを入力します。
myModel.slx
myModel
sltest.harness.SimulationInput
シミュレートする入力オブジェクト。sltest.harness.SimulationInput オブジェクトまたは Simulink.SimulationInput オブジェクトとして指定します。
引数のオプションのペアを Name1=Value1,...,NameN=ValueN として指定します。Name は引数名、Value は対応する値です。名前と値の引数は他の引数の後に表示されなければなりませんが、ペアの順序は重要ではありません。
Name1=Value1,...,NameN=ValueN
Name
Value
R2021a より前では、名前と値をそれぞれコンマを使って区切り、Name を引用符で囲みます。
例: 'InFolder','C:\matlab\myTest'
'InFolder'
C:\matlab\myTest'
InFolder
シミュレートするモデルが格納されたフォルダーの名前。'InFolder' と string または文字ベクトルとして指定されたフォルダーの名前で構成されるコンマ区切りのペアとして指定します。
WithHarness
シミュレートするハーネスの名前。'WithHarness' と string または文字ベクトルとして指定された名前で構成されるコンマ区切りのペアとして指定します。
'WithHarness'
メモ
simulate メソッドでは、関数 sim の名前と値のペアを使用できます。
simulate
sim
シミュレーション結果。Simulink.SimulationOutput オブジェクトとして返されます。
Access
public
Sealed
true
メソッドの属性については、メソッドの属性を参照してください。
classdef simTest < sltest.TestCase methods (Test) function testOne(testCase) simout = testCase.simulate('myModel'); end end end
classdef simTest < sltest.TestCase methods(Test) function testOne(testCase) simInput = Simulink.SimulationInput('myModel'); simOut = testCase.simulate(simInput); end end end
classdef simTest < sltest.TestCase methods(Test) function testOne(testCase) simout = testCase.simulate('myModel',... 'InFolder','C:/matlab/newTestFolder'); end end end
classdef simTest < sltest.TestCase methods (Test) function testOne(testCase) simout = testCase.simulate('myModel',... 'WithHarness','mymodel_Harness1'); end end end
R2020b で導入
sltest.TestCase | Simulink.SimulationInput | Simulink.SimulationOutput | sim
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office