Simulinkにおけるタイムステップの出力
20 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Simulinkにおけるシミュレーションにて,MATLAB function ブロックの計算に毎回のタイムステップを入力してシミュレーションを実施したいです.最適なブロックを教えてください.ちなみにタイムステップは固定ではなく可変のため,毎回測定して出力させたいです.
0 Commenti
Risposta accettata
Shoumei
il 12 Mag 2020
現在時間ではなく、タイムステップということで、現在時間と前のステップとの時間差を取る必要があるのでこんなサンプルを作成してみました。MATLAB Functionブロック内でシミュレーション時間を取得する関数とかがあればもっと簡単に出来るかもしれません。
なお、差分を取るときはMATLAB Functionの中でpersistent変数を使うと良さそうですが、可変ステップではpersistentは使えないようです。
function [timeStep,nowOut] = fcn(nowIn, delayIn)
timeStep = nowIn - delayIn;
nowOut = nowIn;
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su パフォーマンスの手動最適化 in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!