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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1578556/image.png)
댓글 수: 0
답변 (1개)
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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Simulink Functions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!