- https://in.mathworks.com/help/matlab/ref/assignin.html
- https://in.mathworks.com/help/simulink/slref/fromworkspace.html
How to log a .m function output to Simulink in real time?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a continous data stream (I printed it, shown in the below image) coming out from a Matlab Function. I want to import data stream in to Simulink in real time. Data stream is configured within an infinite while loop in order to continously streamline data. ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1463797/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1463797/image.jpeg)
I tried with the below approach. But it didn't work because of the while loop. Any help would be appreciated. Thank you.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1463802/image.jpeg)
0 commentaires
Réponses (1)
Praveen Reddy
le 31 Août 2023
Hi Dimuthu,
I understand that you have a continuous data stream being produced by a MATLAB function and want to import the same into Simulink in real time. A possible approach would be to try the “From Workspace” block in Simulink. You can log the data stream to a base workspace variable using the “assignin” function and configure the “From Workspace” block to read from the base workspace variable.
Please refer to the following MATLAB documentation pages to learn more about the “assignin” function and the “From Workspace” block
Hope this helps!
Voir également
Catégories
En savoir plus sur Sources dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!