Vectorizable Embedded MATLAB Function

버전 1.0.0.1 (192 KB) 작성자: Bill Potter
This set of Simulink models demonstrates how to create a reusable Embedded MATLAB function for scala
다운로드 수: 1.5K
업데이트 날짜: 2016/9/1

라이선스 보기

The three Simulink models provided demonstrate how to develop a reusable Embedded MATLAB function that can be used on scalars and vectors. The Embedded MATLAB function, a simple quadratic equation, is implemented in the model my_eml_func.mdl. This model is referenced as a Model Reference in the library my_lib.mdl. The library contains a configurable subsystem that can be set to either a scalar or vector choice. The scalar choice contains just the reference model for the Embedded MATLAB function and the vector choice contains the same reference model plus a for iterator, vector selector blocks and a vector assignment block. The latter subsystem allows the Embedded MATLAB function to operate in a for loop that addapts to the size of the input signals. A third model, eml_mr_inherited_dim.mdl, includes three instances of the library block to demostrate how the single Embedded MATLAB function can be used for a scalar input, a vector input of width 3 and a vector input of width 5.
This example does have two limitations. This first limitation is that all inputs to the function must have the same vector width. The second limitation is that the Embedded MATLAB function cannot contain any persistent variables.

This technique allows a reusable Embedded MATLAB function to be built and tested once, then the function can be reused many times in other models on any size input vector.

For more information about the Embedded MATLAB subset, please visit the MathWorks web-site:
http://www.mathworks.com/products/featured/embeddedmatlab/

인용 양식

Bill Potter (2024). Vectorizable Embedded MATLAB Function (https://www.mathworks.com/matlabcentral/fileexchange/18075-vectorizable-embedded-matlab-function), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2007b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Prepare Model Inputs and Outputs에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.1

Updated license

1.0.0.0

Corrected summary and added product link.