ヘルプ センターヘルプ センター
Future
保留中、キューに入っている、または実行中の Simulink.Simulation.Future オブジェクトをキャンセルする
Simulink.Simulation.Future
cancel(Future)
例
cancel(Future) は、現在の状態が 'pending'、'queued'、または 'running' である、Simulink.Simulation.Future 配列、Future のオブジェクトを停止します。Futures の要素のうち、状態が 'finished' のものについては、アクションは実行されません。
'pending'
'queued'
'running'
Futures
'finished'
すべて折りたたむ
この例は、cancel メソッドを future オブジェクトの配列に対して使用して、シミュレーションを停止する方法を示します。
cancel
future
この例では、ゲイン Mu の値を変化させて、vdp モデルの複数のシミュレーションを実行します。
vdp
モデルを開き、Mu の値のベクトルを定義します。
openExample('simulink_general/VanDerPolOscillatorExample'); open_system('vdp'); Mu_Values = [0.5:0.25:1000]; MuVal_length = length(Mu_Values)
Mu_Values を使用して、Simulink.SimulationInput オブジェクトの配列を初期化します。配列を事前に割り当てるために、ループ インデックスは最大値から開始されるように作成します。
Mu_Values
Simulink.SimulationInput
for i = MuVal_length:-1:1 in(i) = Simulink.SimulationInput('vdp'); in(i) = in(i).setBlockParameter('vdp/Mu',... 'Gain',num2str(Mu_Values(i))); end
parsim を使用して、モデルのシミュレーションを実行します。シミュレーション実行中にコマンド プロンプトを利用できるようにするため、'RunInBackground' に設定します。
parsim
RunInBackground
Future = parsim(in,'RunInBackground','on');
ここで、異なる Mu の値を使用してシミュレーションを実行するために、実行中のシミュレーションをキャンセルするとします。
Simulation.Simulink.Future
Simulation.Simulink.Future オブジェクトの配列。Future を作成するには、'RunInBackground' オプションを 'on' に設定して parsim を実行します。
'RunInBackground'
'on'
例: Future = parsim(in,'RunInBackground','on')
Future = parsim(in,'RunInBackground','on')
R2018a で導入
batchsim
batch
fetchOutputs
fetchNext
wait
次の 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