simulink to workspace using simout as a scalar value

5 views (last 30 days)
hello everyone,
I need to get the data from simulink to workspace, to do that i have used simout block. BUt i am getting a timeseries . I have even used the array output but still i am getting a multiple output. Is there any way to calculate a single scalar value instead of time series and multple values.
thanks in advance

Answers (1)

Harshal Ritwik
Harshal Ritwik on 19 Jun 2023
Hi,   
As per my understanding you want to know how to get a scaler output by using the “To Workspace” block. If the signal output from your Simulink model is a scalar, then the "To Workspace" block will save the output as a scalar in the workspace variable. If the signal output is a vector or matrix, then the output saved to the workspace variable will be in the form of a vector or matrix accordingly.
So, there is no specific mode to get a scaler output only and to get a scaler output if the signal output is scaler you need to set the parameter VariableName of the “To Workspace” block to “array.
Please refer to the following documentation for more information.
I hope it helps!  
Thanks.  

Categories

Find more on Simulink Functions 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!