Make a signal that changes over time from a simulink block
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Sai Sri Pathuri
el 7 de Ag. de 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 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!