![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1683591/image.png)
Inブロックを活用したシミュレーション
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Simulink上に約30個のInブロックを配置してシミュレーションを実行したいと考えています。
シミュレーションではコンフィグレーションパラメータの「データのインポート/エクスポート」内の入力にチェックを入れて実行していますが、モデル作成途中でシミュレーションを実施したい場合、30個全ての変数データを設定するのは手間なので、「1つの変数だけ設定して後は初期値を維持」といったシミュレーションが出来ればと考えています。
そういったことは可能でしょうか。
よろしくお願いいたします。
0 Commenti
Risposte (1)
交感神経優位なあかべぇ
il 1 Mag 2024
Modificato: 交感神経優位なあかべぇ
il 1 Mag 2024
Simulink.SimulationData.Datasetを使用して、入力データを作成してみました。こういうことでしょうか?
Inブロックが30個あるということでしたら、下記のようなスクリプトを作成しておくと楽ができるのではと思います。
dataset = Simulink.SimulationData.Dataset();
dataset = dataset.addElement(timeseries(sin(linspace(0,2*pi,11)'), (0:10)')); % in1はsin波を出力
dataset = dataset.addElement(timeseries(0.5,0)); % in2は0.5を維持(初期値を維持)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1683591/image.png)
0 Commenti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!