| Contents | Index |
| On this page… |
|---|
How MATLAB Function Blocks Use the BLAS Library When to Disable BLAS Library Support |
The Basic Linear Algebra Subprograms (BLAS) Library is a library of external linear algebra routines optimized for fast computation of low-level matrix operations. By default, MATLAB Function blocks call BLAS library routines to speed simulation whenever possible, except in these cases:
Your C/C++ compiler does not support the BLAS library
The size of the matrix is below a minimum threshold
MATLAB for code generation uses a heuristic to evaluate matrix size against the overhead of calling an external library.
When you are generating C/C++ code for MATLAB functions using Simulink Coder.
Simulink Coder uses BLAS only for simulation.
Consider disabling BLAS library support for MATLAB Function blocks when:
You want your simulation results to more closely agree with code generated by Simulink Coder for your MATLAB Function block.
You are executing code on a 64-bit platform and the number of elements in a matrix exceeds 32 bits.
In this case, automatic truncation to a 32-bit matrix size occurs.
Your platform does not provide a robust implementation of BLAS routines.
MATLAB Function blocks enable BLAS library support by default, but you can disable this feature explicitly for all MATLAB Function blocks in your Simulink model. Follow these steps:
Open your MATLAB Function block.
In the MATLAB Function Block Editor, select Tools > Open Simulation Target.
The Configuration Parameters dialog box opens with Simulation Target selected.
Clear the Use BLAS library for faster simulation check box and click Apply.
MATLAB Function blocks use the BLAS library on all C compilers except:
Watcom
Intel
Borland
The default MATLAB compiler for Windows, 32–bit platforms, lcc, supports the BLAS library. To install a different C compiler, use the mex -setup command, as described in Building MEX-Files in the MATLAB External Interfaces documentation.
![]() | Enhancing Readability of Generated Code for MATLAB Function Blocks | Controlling Run-Time Checks | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |