Rendimiento
Al designar algoritmos de MATLAB® destinados a la generación de código, observe las pautas siguientes para mejorar el rendimiento del código generado.
Bloques
MATLAB Function | Include MATLAB code in Simulink models |
Funciones
coder.areUnboundedVariableSizedArraysSupported | Check if current configuration settings allow unbounded variable-size arrays (desde R2024a) |
coder.inline | Control inlining of current function in generated code |
coder.inlineCall | Inline called function in generated code (desde R2024a) |
coder.nonInlineCall | Prevent inlining of called function in generated code (desde R2024a) |
coder.unroll | Unroll for -loop by making a copy of
the loop body for each loop iteration |
coder.const | Fold expressions into constants in generated code |
Temas
- Unroll for-Loops and parfor-Loops
Control loop unrolling.
- Incrustación de código
La incrustación elimina la sobrecarga de la llamada a una función reemplazando la llamada por el cuerpo de la función.
- Avoid Data Copies of Function Inputs in Generated Code
Generate code that passes input arguments by reference.
- Generate Reusable Code
To reuse functions, save them in files or integrate external functions into generated code.
- Control Run-Time Checks
Improve performance by disabling run-time checks.
- LAPACK Calls for Linear Algebra in a MATLAB Function Block
LAPACK function calls improve the simulation speed of MATLAB Function block algorithms that call certain linear algebra functions.
- BLAS Calls for Matrix Operations in a MATLAB Function Block
BLAS function calls improve the simulation speed of MATLAB Function block algorithms that call certain low-level vector and matrix functions.
- FFTW calls for fast Fourier transform functions in a MATLAB Function Block
FFTW function calls improve the simulation speed of MATLAB Function block algorithms that call MATLAB fast Fourier transform (FFT) functions.