How do I collect lots of data from Simulink to MatLab Workspace with To Workspace block?

1 ビュー (過去 30 日間)
Katéri Tremblay
Katéri Tremblay 2021 年 8 月 11 日
回答済み: Pavan Guntha 2021 年 8 月 31 日
I am discharging a battery unity with Simulink and an STM32. I am collecting voltage and current data from the discharge with the Monitoring and Tunning option in Simulink with a simulation time of 3600 seconds. I can clearly see the values of voltages and currents in my Display blocks. I can also clearly see the evolution of the data with time in my Scope block. I am using a To Workspace block to pass the data from Simulink to MatLab. My To Workspace blocks are called Voltage and Courant (for currents). I have tried all the save formats proposed by the block to pass my data from Simulink to MatLab and nothing works... My To Workspace sampled time is 1 second. I would like if anyone could help me with this problem.
Best regards, Katéri Tremblay

回答 (1 件)

Pavan Guntha
Pavan Guntha 2021 年 8 月 31 日
Hello Katéri Tremblay,
One of the possible solutions is to use 'Output' blocks and log the outputs into workspace variables through 'Model Configuration Settings'. In the figure below, 2 outputs (Output1 & Output2) represent the data to be logged into workspace.
By configuring the model settings as shown below, we could log the outputs into 'out.yout' in the MATLAB workspace.
For more details on Model Configuration settings, you could have a look at the following documentation page:
Hope this helps!


Community Treasure Hunt

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

Start Hunting!

Translated by