이 번역 페이지는 최신 내용을 담고 있지 않습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.
가변 크기 데이터
코드 생성 시, 코드 생성기는 스칼라, 벡터, 행렬을 포함해 배열을 고정 크기 또는 가변 크기로 식별합니다.
코드 생성기가 배열의 크기를 확인할 수 없거나 배열의 크기가 변하는 경우 코드 생성기는 그 배열을 가변 크기로 지정합니다.
코드 생성기는 배열의 크기가 변하지 않는다고 확인되면 그 배열을 고정 크기로 지정합니다.
코드 생성기가 고정 크기 배열과 가변 크기 배열을 처리하는 방법을 이해하면 코드 생성 시 오류를 진단하고 수정하는 데 도움이 될 수 있습니다. 사용자의 애플리케이션이 가변 크기 배열을 필요로 하지 않는 경우, 가변 크기 설정과 동적 메모리 할당을 세밀하게 조정하여 생성 코드의 성능을 개선할 수도 있습니다.
함수
coder.areUnboundedVariableSizedArraysSupported | Check if current configuration settings allow unbounded variable-size arrays (R2024a 이후) |
coder.varsize | Resolve size incompatibility errors and declare upper bounds |
도움말 항목
- 가변 크기 배열에 대한 코드 생성
가변 크기 데이터는 컴파일할 때 데이터 크기를 알 수 없거나 런타임에 데이터 크기가 변할 수 있는 데이터입니다.
- Define Variable-Size Arrays in MATLAB Code
- Control Dynamic Memory Allocation in Generated Code
Balance memory usage and performance by controlling dynamic memory allocation for fixed- and variable-size arrays.
- Specify Upper Bounds for Variable-Size Arrays in Generated Code
To avoid dynamic memory allocation, specify upper bounds for variable-size arrays.
- Incompatibilities with MATLAB in Variable-Size Support for Code Generation
Understand how the behavior of the generated code can differ from MATLAB® as a result of variable-size data.
- Use Dynamically Allocated C Arrays in the Generated Function Interfaces
Understand and use dynamically allocated arrays from the generated C function interfaces.
- Use Dynamically Allocated C++ Arrays in Generated Function Interfaces
Understand and use dynamically allocated arrays from the generated C++ function interfaces.
문제 해결
코드 생성 중에 발생하는 크기 비호환성 오류를 해결합니다.
크기 불일치 및 상한 감지 오류를 해결합니다.
Resolve Error: coder.varsize Not Supported for Strings
Troubleshoot code generation error when using coder.varsize
with string variables.