フィルターのクリア

Make a signal that changes over time from a simulink block

1 回表示 (過去 30 日間)
Marzieh Karami
Marzieh Karami 2019 年 7 月 31 日
回答済み: Sai Sri Pathuri 2019 年 8 月 7 日
I am using a MAtLAB function inside simulink to program a DSP. The function is running based on a sample time 0.2 ms. At each sample time, I want to output a matrix of values with the sampling time of 1 us. So I want the output to be a matrix of 1*200. I dont know how to make this matrix in a way that the PWM block receives subsequent elements in each 1 us.

回答 (1 件)

Sai Sri Pathuri
Sai Sri Pathuri 2019 年 8 月 7 日
If the output matrix of function is input dependent, you may not produce a matrix with sampling time of 1 us, since the MATLAB function block produces, and updates output at every 0.2 ms.
If the matrix is input independent, you may use for loop that runs 200 times inside the MATLAB function block and update the matrix at each iteration. Even here the output matrix is updated at 0.2 ms only.
If you want to send data to PWM block at each 1 us, you may change the sampling time of function block to 1 us and instead of inserting value into the matrix, send the value directly to the PWM block.

カテゴリ

Help Center および File ExchangeArray and Matrix Mathematics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by