simulink to workspace using simout as a scalar value

5 次查看(过去 30 天)
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

回答(1 个)

Harshal Ritwik
Harshal Ritwik 2023-6-19
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.  

类别

Help CenterFile Exchange 中查找有关 Simulink Functions 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by