Make a signal that changes over time from a simulink block
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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.
0 commentaires
Réponses (1)
Sai Sri Pathuri
le 7 Août 2019
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.
0 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!