이 페이지는 기계 번역을 사용하여 번역되었습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.
서브시스템
서브시스템을 위한 코드 생성 및 재사용
모델의 크기와 복잡성을 줄이기 위해 블록을 Subsystem 블록으로 그룹화할 수 있습니다. 개별 서브시스템에 대한 모듈식 코드와 단위 테스트 코드를 생성하기 위해 Atomic Subsystem을 구성하여 개별 함수와 파일에 대한 코드를 생성할 수 있습니다.
서브시스템은 가상 서브시스템이거나 Atomic Subsystem일 수 있습니다. 가상 서브시스템은 모델에 그래픽 계층을 제공하며 모델 실행에 영향을 미치지 않습니다. 모델 내에서 Atomic Subsystem은 하나의 단위로 실행됩니다. 코드 생성기는 조건부 실행 서브시스템을 지원합니다.
도움말 항목
코드 생성
- Generate Code and Executables for Individual Subsystems
Generate and build a standalone executable from a subsystem. - Generate Subsystem Code as Separate Function and Files
Configure subsystems to generate functions in separate files and specify the names of those functions and files. - Generate Predictable Function Interface to Match Graphical Block Interface
Generate a nonreusable subsystem function interface that does not change. - Generate Code for Variant Subsystem Blocks
Generate code for specific implementation of component represented using Variant Subsystem block. - Modeling Guidelines for Generated Code
Overview of guidelines to consider for your model and generated code, including coding guidelines, component deployment modeling guidelines, and MathWorks Advisory Board guidelines (MAB).
코드 최적화
- Generate Inlined Subsystem Code
Configure nonvirtual subsystems to generate inlined code.
코드 재사용
- Function Reuse in Generated Code
This example shows how to configure an atomic subsystem for generating reusable code. - Determine Why Subsystem Code Is Not Reused
Determine why the code generator does not reuse subsystem code as you expect. - Generate Reusable Code from Model Reference Hierarchy
Generate reusable subsystem code from a top model with Model blocks. - Generate Reentrant Code from Subsystems
Generate reusable, reentrant code from subsystems. - Generate Reusable Code from For Each Subsystems
Generate reusable code for For Each subsystems that perform the same processing.