이 페이지는 기계 번역을 사용하여 번역되었습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.
사용자 지정 블록을 위한 코드 생성
S-Function을 사용하여 사용자 지정 블록에 대한 코드 생성 동작을 정의
S-Function은 MATLAB®, C, C++ 또는 Fortran으로 작성된 Simulink® 블록에 대한 컴퓨터 언어 설명입니다. Simulink 엔진과 상호 작용하는 프로그래밍 인터페이스를 사용하여 외부 코드를 나타내는 S-Function을 개발할 수 있습니다. 코드 생성기에서 이 S-Function을 사용하여 코드를 생성하십시오. S-Functions and Code Generation에서 시작해 보십시오.
생성된 코드와 외부 코드 간의 인터페이싱을 위한 더 간단한 대체 접근 방식은 외부 코드 가져오기 항목을 참조하십시오.
블록
| Generated S-Function | Represent model or subsystem as generated S-function code |
도움말 항목
S-Function 작성
- S-Functions and Code Generation
Use S-functions to extend Simulink support for simulation and code generation. - Build Integrated Code Within the Simulink Environment
Add support files and control model code generation and builds within the Simulink Environment. - Write Noninlined S-Function
Implement your algorithm according to the S-function API by writing a C or C++ MEX S-function. - Write Wrapper S-Function and TLC Files
Create S-functions that serve as wrappers for existing code. - Write Fully Inlined S-Functions
Inline your algorithm in the TLC file for code generation.
- Write Fully Inlined S-Functions with mdlRTW Routine
Use themdlRTWcallback method in an inlined S-function. - S-Functions for Multirate Multitasking Environments
Explains how to handle rate-grouped tasks in multirate, port-based sample time S-functions. - Use S-Function Target for Model or Subsystem
Use a shared library generated from a model or subsystem that you can load dynamically into another application.
레거시 코드 툴
- Import Calls to External Code into Generated Code with Legacy Code Tool
Import calls to external code for utility functions, lookup tables, filters, and device drivers into the Simulink environment for simulation and code generation. - Legacy Code Tool Examples
Learn how to use the Legacy Code Tool to generate fully inlined C MEX S-functions for legacy or custom code.


