| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Real-Time Workshop |
| Contents | Index |
| Learn more about Real-Time Workshop |
| On this page… |
|---|
How Embedded MATLAB Functions 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, Embedded MATLAB functions call BLAS library routines to speed up simulation, except in these cases:
Your C/C++ compiler does not support the BLAS library
The size of the matrix is below a minimum threshold
The Embedded MATLAB subset uses a heuristic to evaluate matrix size against the overhead of calling an external library.
When you are generating C/C++ code for Embedded MATLAB functions using Real-Time Workshop software.
Embedded MATLAB uses BLAS only for simulation.
Consider disabling BLAS library support for Embedded MATLAB functions when:
You are executing code on a 64-bit platform and the number of elements in a matrix exceeds 32-bits.
In this case, Embedded MATLAB automatically truncates the matrix size to 32 bits.
Your platform does not provide a robust implementation of BLAS routines.
Embedded MATLAB functions enable BLAS library support by default, but you can disable this feature explicitly from the command line or the Compiler Options dialog box. Follow these steps:
Define the MEX configuration object in the MATLAB workspace by issuing a constructor command, like this:
mexcfg = emlcoder.MEXCfg
Disable the BLAS option, either from the command line or Automatic MEX Generation dialog box.
From the command line set the enableBLAS property false by issuing a command like this:
mexcfg.enableBLAS = false;
From the Automatic MEX Generation dialog box, follow these steps:
Open the Automatic MEX Generation dialog box by issuing a command like this:
open mexcfg
Uncheck the Use BLAS library if possible check box and click Apply.
The Embedded MATLAB subset uses the BLAS library on all C/C++ compilers except:
Watcom
Intel
Borland
The default MATLAB compiler, lcc, supports the BLAS library. To install a different C/C++ compiler, use the mex -setup command, as described in Building MEX-Files in the MATLAB External Interfaces documentation.
![]() | Integrating Custom C/C++ Code with Generated Code | Controlling Runtime Checks | ![]() |

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