이 번역 페이지는 최신 내용을 담고 있지 않습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.
함수 정의
함수
coder.extrinsic | 함수를 외재적 함수로 선언하고 MATLAB에서 실행 |
coder.ignoreConst | 표현식의 상수 값을 사용한 함수 특수화 금지 |
coder.mustBeConst | Validate that value is a compile-time constant (R2023b 이후) |
coder.unroll | Unroll for -loop by making a copy of
the loop body for each loop iteration |
coder.sameSizeBinaryOp | Apply element-wise binary operations without implicit expansion (R2021b 이후) |
coder.noImplicitExpansionInFunction | Disable implicit expansion within the specified function in the generated code (R2021b 이후) |
coder.read | Read data files at run time in generated code (R2023a 이후) |
coder.write | Create data files that the generated code reads at run time (R2023a 이후) |
도움말 항목
- 컴파일 지시문 %#codegen
MATLAB® 함수가 코드 생성을 위한 것임을 표시합니다.
- Generate Code With Implicit Expansion Enabled
The code generator introduces modifications in the generated code to accomplish implicit expansion.
- Optimize Implicit Expansion in Generated Code
Implicit expansion in the generated code is enabled by default.
- 가변 길이 인수 목록에 대한 코드 생성
varargin
및varargout
에 대한 코드를 생성합니다. - Generate Code for arguments Block That Validates Input and Output Arguments
Generate code for MATLAB code that constrains class, size, and other aspects of function input and output values.
- Code Generation for Recursive Functions
Use recursive functions in MATLAB code that is intended for code generation.
- Force Code Generator to Use Run-Time Recursion
Rewrite your MATLAB code so that the code generator uses run-time recursion instead of compile-time recursion.
- 익명 함수에 대한 코드 생성
코드 생성을 위한 MATLAB 코드에 익명 함수를 사용합니다.
- Code Generation for Nested Functions
Use nested functions in MATLAB code intended for code generation.
- Resolution of Function Calls for Code Generation
The code generator uses precedence rules to resolve function calls.
- Resolution of File Types on Code Generation Path
The code generator uses precedence rules to resolve file types.
- Use MATLAB Engine to Execute a Function Call in Generated Codein MATLAB Function BlocksDuring Fixed-Point Algorithm Acceleration
If a function is not supported for code generation, declare it as extrinsic to execute in MATLAB.
문제 해결
for 루프에서 varargin 또는 varargout에 대한 인덱스가 상수가 아닌 경우
코드 생성기가 varargin
또는 varargout
에 대한 인덱스 값을 확인할 수 없는 경우 루프 풀기를 강제로 실행합니다.
Output Variable Must Be Assigned Before Run-Time Recursive Call
Troubleshoot output variable assignment for run-time recursion.
Compile-Time Recursion Limit Reached
Troubleshoot compile-time recursion limit error.