이 페이지는 기계 번역을 사용하여 번역되었습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.
코드 모양
생성된 코드의 식별자, 코드 스타일, 주석, 함수, 파일 배너를 제어
주석 스타일, 데이터형 형변환 모드, 들여쓰기 스타일 등 코드 모양과 스타일의 측면을 제어하는 구성 파라미터를 수정합니다. 코드 모양과 스타일을 제어하는 파라미터에 대해서는 MATLAB 코드에서 코드 생성을 위한 Embedded Coder 기능 항목을 참조하십시오.
코드 생성 템플릿(CGT) 파일을 사용자 지정하여 코드 섹션 전에 사용자 지정 배너와 트레일러, 주석을 생성합니다. Generate Custom File and Function Banners for C/C++ Code 항목을 참조하십시오.
함수
coder.setupMISRAConfig | Configure parameters to improve generated code compliance with MISRA and AUTOSAR guidelines |
클래스
coder.MATLABCodeTemplate | Represent code generation template for MATLAB Coder |
도움말 항목
코드 주석
- Specify Comment Style for C/C++ Code
Generate single-line or multiline comments in C/C++ code generated from MATLAB® code.
식별자
- Customize Generated Identifiers
Specify format of identifiers in C/C++ code generated from MATLAB code.
파일 이름
- Customize C/C++ File Names Generated from MATLAB Code
Specify format of C/C++ file names generated from MATLAB code.
코드 스타일
- C 코드 스타일 제어
MATLAB 코드에서 생성된 C/C++ 코드에서if-elseif-else
문 대신switch-case
문을 생성합니다. - Specify Indent Style for C/C++ Code
Use K&R or Allman indent style in C/C++ code generated from MATLAB code. - Control Signed Left Shifts in Generated Code
Control whether the code generator replaces multiplications by powers of two with signed, left bitwise shifts in code generated from MATLAB code. - Control Data Type Casts in Generated Code
Specify the data type casting mode, that is, default mode, standards compliant mode, or explicit mode, in C/C++ code generated from MATLAB code. - Generate C/C++ Code with Improved MISRA and AUTOSAR Compliance
Configure code generation parameters to increase the MISRA™ and AUTOSAR compliance of the generated C/C++ code.
데이터형 이름 제어
- Customize Data Type Replacement
Specify custom data type names in C/C++ code generated from MATLAB code. - Import Custom Data Type Definitions from External Header Files
Specify header file names, which contain custom type definitions, that you want to import.
코드 템플릿
- Code Generation Template Files for MATLAB Code
A CGT file specifies file and function banners, and comments before code sections in C/C++ code generated from MATLAB code. - Generate Custom File and Function Banners for C/C++ Code
Customize a CGT file to generate your own file and function banners in C/C++ code generated from MATLAB code.
문제 해결
MATLAB Code Patterns That Require a Nonempty Initialize Function in Generated Code
Code generation fails when you choose not to include the initialize function, even though the custom code for the generated initialize function is empty.