Clear Filters
Clear Filters

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

1 view (last 30 days)
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.

Answers (1)

Dinesh
Dinesh on 29 Dec 2023
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.

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!