이 페이지는 기계 번역을 사용하여 번역되었습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.
코드 스타일
코드 생성기를 스타일 규칙에 따라 구성하여 코드를 더 읽기 쉽고 일관되게 만들 수 있습니다. 코드 생성기는 괄호나 도달할 수 없는 명령문과 같은 선택적인 구문적 기능을 제거하거나 포함할 수 있습니다.
성능이나 가독성을 우선시하는 방식으로 특정 작업을 구현하도록 코드 생성기를 구성할 수 있습니다. 예를 들어, 2의 거듭제곱으로 곱할 때 곱셈 연산자를 사용하는 것보다 부호 있는 비트 단위 시프트를 사용하는 것이 효율적이지만 가독성이 떨어집니다. 두 가지 방법 중 하나를 선호하도록 코드 생성기를 구성할 수 있습니다.
도움말 항목
- Enhance Readability of Code for Flow Charts
Describes how to convert if-elseif-else code to switch-case statements to enhance readability of generated code.
- Enhance Code Readability for MATLAB Function Blocks
Convert if-elseif-else code to switch-case statements.
- Improve Data Coherency in Generated Code
Generate a single unique variable for each Data Store read and write operation and thereby enhance Data Coherency.
- Control Parentheses in Generated Code
Specify how parentheses are placed in the code.
- Optimize Code by Reordering Commutable Operands
Reorder the execution of operands in the generated code to improve efficiency.
- Suppress Generation of Default Cases for Unreachable Stateflow Switch Statements
Specify if a default case is generated among switch-case statements.
- Replace Multiplication by Powers of Two with Signed Bitwise Shifts
Specify whether to replaces multiplication by powers of two with signed bitwise shifts.
- Generate Code Containing Right Shifts on Signed Integers
Specify whether the generated code contains right shifts on signed integers.
- Control Cast Expressions in Generated Code
Control the data type casts that the code generator specifies in the generated code.