The variables in Simulink cannot be displayed in the workspace.
2 views (last 30 days)
Show older comments
“I want to import the SOC variable (which is a matrix) output by Simulink using the ‘To Workspace’ block into the MATLAB workspace for viewing. However, what I see in the workspace is just the variable name. How can I make it display the actual values? Can you please provide me with specific instructions on how to do this? Thank you.”

0 Comments
Answers (1)
Fangjun Jiang
on 7 Aug 2023
This is because the saving format in the "To Workspace" block is specified as "time series" or "data set". If the variable name is "Var", you can do the following to view the data.
open Var
plot(Var)
Var.Data
If you specify the saving format to be "Array", then you can just type "Var" to see the data.
0 Comments
See Also
Categories
Find more on Sources in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!