Effacer les filtres
Effacer les filtres

Simulinkにおけるタイムステップの出力

9 vues (au cours des 30 derniers jours)
kazuki watada
kazuki watada le 8 Mai 2020
Simulinkにおけるシミュレーションにて,MATLAB function ブロックの計算に毎回のタイムステップを入力してシミュレーションを実施したいです.最適なブロックを教えてください.ちなみにタイムステップは固定ではなく可変のため,毎回測定して出力させたいです.

Réponse acceptée

Shoumei
Shoumei le 12 Mai 2020
現在時間ではなく、タイムステップということで、現在時間と前のステップとの時間差を取る必要があるのでこんなサンプルを作成してみました。MATLAB Functionブロック内でシミュレーション時間を取得する関数とかがあればもっと簡単に出来るかもしれません。
なお、差分を取るときはMATLAB Functionの中でpersistent変数を使うと良さそうですが、可変ステップではpersistentは使えないようです。
function [timeStep,nowOut] = fcn(nowIn, delayIn)
timeStep = nowIn - delayIn;
nowOut = nowIn;

Plus de réponses (0)

Catégories

En savoir plus sur パフォーマンスの手動最適化 dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!