Problem in using variable defined in .m file into matlab simulink

1 次查看(过去 30 天)
I have defined a variable with respect to time in matlab coding- .m file. Variable is defined at every 0.001sec and that variable is defined in workspace too. Now I am using this variable as input in my matlab simulink model in From "Workspace" block but it shows error as shown below. Please suggest me solution.

回答(1 个)

Dinesh
Dinesh 2023-12-29
Hi Pushkar.
The error messages indicate that Simulink cannot determine the sizes or types of outputs for the MATLAB Function block, which may not be directly related to the input from the workspace. However, they also suggest there may be an issue with the dimensions of the input being passed to the 'Output Port 1'. It's possible that the variable from the workspace is not correctly formatted or defined, leading to issues when Simulink tries to infer the dimensions or types.
The following link is a link to the documentation:
For instance, if you are creating a signal that changes every 0.001 seconds, you can format the data as a timeseries object or an array with time as the first column and the signal values in the subsequent columns.

类别

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