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

조회 수: 2 (최근 30일)
Hello,
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!

카테고리

Help CenterFile Exchange에서 Prepare Model Inputs and Outputs에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by