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

8 ビュー (過去 30 日間)
Pushkar
Pushkar 2023 年 12 月 29 日
回答済み: Dinesh 2023 年 12 月 29 日
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 Center および File ExchangeSignal Attributes and Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by