RN 34
RN 34
RN 34
www.mathworks.com
www.mathworks.com/sales_and_services
User community:
www.mathworks.com/matlabcentral
Technical support:
www.mathworks.com/support/contact_us
Phone:
508-647-7000
Trademarks
MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See
www.mathworks.com/trademarks for a list of additional trademarks. Other product or brand
names may be trademarks or registered trademarks of their respective holders.
Patents
MathWorks products are protected by one or more U.S. patents. Please see
www.mathworks.com/patents for more information.
Contents
R2015a
Improved MATLAB Coder app with integrated editor and
simplified workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-2
1-3
1-4
1-4
1-5
1-5
1-5
1-6
1-6
1-6
1-6
1-7
1-7
1-7
1-7
1-7
vi
Contents
1-8
1-8
1-9
1-9
1-10
1-10
1-12
1-12
1-12
1-13
1-13
1-14
1-14
1-14
1-14
1-14
1-14
1-16
1-9
1-15
1-15
R2014b
Code generation for additional Image Processing Toolbox
and Computer Vision System Toolbox functions . . . . . . . .
Image Processing Toolbox . . . . . . . . . . . . . . . . . . . . . . . . . . .
Computer Vision System Toolbox . . . . . . . . . . . . . . . . . . . . .
2-2
2-2
2-2
2-2
2-2
2-2
2-3
2-4
2-4
2-5
2-5
2-5
2-6
2-6
2-6
2-6
2-6
2-7
vii
2-8
2-8
2-8
2-9
2-10
2-10
2-10
2-11
2-12
2-14
R2014a
viii
Contents
3-2
3-2
3-2
3-2
3-2
3-3
3-3
3-3
3-3
3-3
3-4
3-4
3-4
3-4
3-5
3-5
3-6
3-6
3-9
3-9
3-9
3-9
3-9
3-10
3-10
3-11
3-13
3-13
3-13
3-13
3-14
3-15
ix
R2013b
Contents
4-2
4-2
4-3
4-3
4-3
4-3
4-3
4-4
4-4
4-4
4-4
4-5
4-5
4-6
4-6
4-6
4-7
4-7
4-7
4-9
R2013a
Automatic fixed-point conversion during code generation
(with Fixed-Point Designer) . . . . . . . . . . . . . . . . . . . . . . . . .
5-2
5-2
5-3
5-3
5-3
5-4
5-4
5-4
5-5
5-5
5-6
5-6
5-6
5-7
5-8
xi
5-9
5-9
5-9
5-11
5-12
R2012b
xii
Contents
6-2
6-2
6-2
6-2
6-3
6-3
6-4
6-5
6-5
6-5
6-6
6-8
R2012a
Code Generation for MATLAB Classes . . . . . . . . . . . . . . . . . .
7-2
7-2
7-2
7-2
7-3
7-3
7-4
7-4
New Demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7-4
7-5
R2011b
Support for Deletion of Rows and Columns from Matrices .
8-2
8-2
8-3
xiii
R2011a
xiv
Contents
9-2
9-2
9-2
9-2
9-4
9-5
9-6
9-6
9-6
9-7
9-7
New Demos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9-7
9-8
9-8
9-10
9-5
9-5
R2015a
Version: 2.8
New Features
Bug Fixes
Compatibility Considerations
R2015a
On the Generate Code page, to open the Generate dialog box, click the Generate
arrow
In the Generate dialog box, set Build type to one of the following:
Source Code
Static Library (.lib)
Dynamic Library (.dll)
Executable (.exe)
On the All Settings tab, under Advanced, set Generate example main to one of
the following:
Do not generate an example main function
Generate, but do not compile, an example main function (default)
Generate and compile an example main function
R2015a
Create a code configuration object for 'lib', 'dll', or 'exe'. For example:
cfg = coder.config('lib'); % or dll or exe
Compatibility Considerations
If your MATLAB code uses large arrays or structures, in some cases, the extra memory to
preserve your variable names can affect performance. To reduce memory usage, specify
that the variable reuse optimization does not have to preserve variable names:
Using a project, in the Project Settings dialog box, on the All Settings tab, set
Preserve variable names to None.
Using the command-line interface, set the configuration object property
PreserveVariableNames to None.
See Reuse Large Arrays and Structures.
1-4
function x = foo(x,N)
assert(all(size(x) == [1 100]))
x(x>N) = N;
R2015a
R2015a
In previous releases, the software did not recognize that field s.a was constant. In the
generated code, if variable-sizing was enabled, y was a variable-size array. If variablesizing was disabled, the code generation software reported an error. In R2015a, the
software recognizes that s.a is a constant. y is a static row vector with 10 elements.
As a result of this improvement, you can use individual assignments to assign constant
values to structure fields. For example:
function y = mystruct(x)
s.a = 3;
s.b = 4;
y = zeros(s.a,s.b);
In previous releases, the software recognized the constants only if you defined the
complete structure using the struct function: For example:
1-8
function y = mystruct(x)
s = struct('a', 3, 'b', 4);
y = zeros(s.a,s.b);
In some cases, the code generation software cannot recognize constant structure fields or
array elements. See Code Generation for Constants in Structures and Arrays.
Compatibility Considerations
The improved recognition of constant fields and elements can cause the following
differences between code generated in R2015a and code generated in previous releases:
A function output can be more specific in R2015a than it was in previous releases. An
output that was complex in previous releases can be real in R2015a. An array output
that was variable-size in previous releases can be fixed-size in R2015a.
Some branches of code that are present in code generated using previous releases are
eliminated from the generated code in R2015a.
<baseType> is the type of the elements of the emxArray. The inputs to this function are
a pointer to an emxArray pointer and the number of dimensions. For example:
1-9
R2015a
A function that creates empty emxArrays in a structure has a name of the form:
void emxInitArray_<structType>
<structType> is the type of the structure. The input to this function is a pointer to the
structure that contains the emxArrays. For example:
void emxInitArray_cstruct0_T(cstruct0_T *structure);
MATLAB Coder also generates functions that free the dynamic memory that the
functions that create the emxArrays allocate. For example, the function that frees
dynamic memory that emxInitArray_real_T allocates is:
void emxDestroyArray_real_T(emxArray_real_T *emxArray)
The function that frees dynamic memory that emxInitArray_cstruct0_T allocates is:
void emxDestroyArray_struct0_T(struct0_T *structure)
Code generation for casts to and from types of variables declared using
coder.opaque
For code generation, you can use the MATLAB cast function to cast a variable to or from
a variable that is declared using coder.opaque. Use cast with coder.opaque only for
numeric types.
To cast a variable declared by coder.opaque to a MATLAB type, you can use the B =
cast(A,type) syntax. For example:
1-10
x = coder.opaque('size_t','0');
x1 = cast(x, 'int32');
Use cast with coder.opaque to generate the correct data types for:
Inputs to C/C++ functions that you call using coder.ceval.
Variables that you assign to outputs from C/C++ functions that you call using
coder.ceval.
Without this casting, it is possible to receive compiler warnings during code generation.
Consider this MATLAB code:
yt = coder.opaque('size_t', '42');
yt = coder.ceval('foo');
y = cast(yt, 'int32');
It is possible that the explicit cast in the generated code prevents a compiler warning.
1-11
R2015a
Compatibility Considerations
For an entry-point function with structure arguments, if the PassStructByReference
property has the default value, codegen generates a different function signature in
R2015a than in previous releases.
Here is an example of a function signature generated in R2015a using the codegen
command with the PassStructByReference property set to the default value, true:
1-12
R2015a
Compatibility Considerations
For manual fixed-point conversion, use the command-line workflow. This workflow
uses the Fixed-Point Designer functions buildInstrumentedMex and
showInstrumentationResults. See Manually Convert a Floating-Point MATLAB
Algorithm to Fixed Point in the Fixed-Point Designer documentation.
Preserves the indentation and formatting of your original algorithm, improving the
readability of the generated fixed-point code.
Automated fixed-point conversion of additional DSP System Toolbox objects
If you have a DSP System Toolbox license, you can now convert the following DSP
System Toolbox System objects to fixed-point:
dsp.FIRDecimator
dsp.FIRInterpolator
dsp.FIRFilter, direct form and direct form transposed only
dsp.LUFactor
dsp.VariableFractionalDelay
dsp.Window
You can propose and apply data types for these System objects based on simulation
range data. Using the MATLAB Coder app, during the conversion process, you can view
simulation minimum and maximum values and proposed data types for these System
objects. You can also view whole number information and histogram data. You cannot
propose data types for these System objects based on static range data.
New interpolation method for generating lookup table MATLAB function replacements
The coder.approximation function now offers a 'Flat' interpolation method for
generating lookup table MATLAB function replacements. This fully specified lookup
table achieves high speeds by discarding the prelookup step and reducing the use of
multipliers in the data path. This interpolation method is available from the commandline workflow, and in the Function Replacements tab of the Fixed-Point Conversion
step.
1-15
R2015a
1-16
R2014b
Version: 2.7
New Features
Bug Fixes
Compatibility Considerations
R2014b
imadjust
intlut
ordfilt2
bwtraceboundary
imclearborder
iptcheckmap
rgb2ycbcr
fitgeotrans
imlincomb
medfilt2
stretchlim
histeq
imquantize
multithresh
ycbcr2rgb
For the list of Image Processing Toolbox functions supported for code generation, see
Image Processing Toolbox.
Computer Vision System Toolbox
bboxOverlapRatio
selectStrongestBbox
vision.DeployableVideoPlayer on Linux
For the list of Computer Vision System Toolbox functions supported for code
generation, see Computer Vision System Toolbox.
dsp.FarrowRateConverter
dsp.FilterCascade
You cannot generate code directly from this System object. You can use the
generateFilteringCode method to generate a MATLAB function. You can
generate C/C++ code from this MATLAB function.
dsp.FIRDecimator for transposed structure
dsp.FIRHalfbandDecimator
dsp.FIRHalfbandInterpolator
dsp.PeakToPeak
dsp.PeakToRMS
dsp.PhaseExtractor
dsp.SampleRateConverter
dsp.StateLevels
For the list of DSP System Toolbox functions and System objects supported for code
generation, see DSP System Toolbox.
R2014b
For the other base types, the code generation software generates a typedef statement
for the enumerated type and #define statements for the enumerated values. For
example:
typedef short LEDColor;
#define GREEN ((LEDColor)1)
#define RED((LEDColor)2)
2-4
RED(2)
end
methods(Static)
function y = addClassNameToEnumNames()
y = true;
end
end
end
Compatibility Considerations
The name of an enumerated type value in code generated using previous releases differs
from the name generated using R2014b. If you have code that uses one of these names,
modify the code to use the R2014b name or generate the name so that it matches the
name from a previous release. If you want an enumerated type value name generated in
R2014b to match the name from a previous release, in the enumerated types definition,
modify the addClassNameToEnumNames method to return true instead of false.
R2014b
Compatibility Considerations
Unless the target C compiler has a maximum identifier length that equals the length of
a truncated exported identifier from a previous release, the identifier from the previous
release does not match the identifier that R2014b generates. For example, suppose the
maximum identifier length setting has the default value 31 and the target C compiler
has a maximum identifier length of 255. Suppose that in R2014b, the code generation
software generates the function emxCreateWrapperND_StructType_123 for an
unbounded variable-size structure array named StructType_123. In previous releases,
the same function had the truncated name emxCreateWrapperND_StructType_1. In
this example, code that previously called emxCreateWrapperND_StructType_1 must
now call emxCreateWrapperND_StructType_123.
R2014b
The default comparison plots now plot vector and matrix data in addition to scalar data.
Custom plotting functions
You can now specify your own custom plotting function. The Fixed-Point Conversion
tool calls the function and, for each variable, passes in the name of the variable and the
function that uses it, and the results of the floating-point and fixed-point simulations.
Your function should accept three inputs:
A structure that holds the name of the variable and the function that uses it.
A cell array to hold the logged floating-point values for the variable.
A cell array to hold the logged values for the variable after fixed-point conversion.
For example, function customComparisonPlot(varInfo, floatVarVals,
fixedPtVarVals).
To use a custom plot function, in the Fixed-Point Conversion tool, select Advanced, and
then set Custom plot function to the name of your plot function.
In the command-line workflow, set the coder.FixptConfig configuration object
PlotFunction property to the name of your plot function.
See Custom Plot Functions.
Integration with Simulation Data Inspector
You can now use the Simulation Data Inspector for comparison plots. The Simulation
Data Inspector provides the capability to inspect and compare logged simulation data for
multiple runs. You can import and export logged data, customize the organization of your
logged data, and create reports.
In the Fixed-Point Conversion tool, select Advanced and then set Plot with
Simulation Data Inspector to Yes. See Enable Plotting Using the Simulation Data
Inspector.
2-9
R2014b
2-11
R2014b
number in the Function list which makes it easy to trace between the floating-point and
fixed-point versions of your code. For example, the generated fixed-point function for the
specialization of function foo named foo > 1 is named foo_s1. For more information,
see Specializations.
Highlighting of potential data type issues in generated HTML report
You now have the option to highlight potential data type issues in the generated HTML
report. The report highlights MATLAB code that requires single-precision, doubleprecision, or expensive fixed-point operations. The expensive fixed-point operations check
identifies optimization opportunities for fixed-point code. It highlights expressions in
the MATLAB code that require cumbersome multiplication or division, or expensive
rounding. The following example report highlights MATLAB code that requires expensive
fixed-point operations.
2-12
The checks for the data type issues are disabled by default.
To enable the checks in a project:
1
In the Fixed-Point Conversion Tool, click Advanced to view the advanced settings.
2-13
R2014b
2-14
R2014a
Version: 2.6
New Features
Bug Fixes
Compatibility Considerations
R2014a
im2uint16
imhist
bwpack
im2uint8
imopen
bwselect
imbothat
imref2d
bwunpack
imclose
imref3d
edge
imdilate
imtophat
getrangefromclass
imerode
imwarp
im2double
imextendedmax
mean2
im2int16
imextendedmin
projective2d
im2single
imfilter
strel
firhalfband
ifir
iirnotch
cl2tf
firlpnorm
iircomb
iirpeak
firceqrip
firminphase
iirgrpdelay
tf2ca
fireqint
firnyquist
iirlpnorm
tf2cl
firgr
firpr2chfb
iirlpnormc
dsp.DCBlocker
R2014a
If you omit the -script option, the coder command writes the script to the Command
Window.
See Convert MATLAB Coder Project to MATLAB Script.
On the Overview tab, click Add global. Enter a name for the global variable.
Enter the value in the field to the right of the global variable name.
To declare a constant global variable at the command-line interface, use the -globals
option along with the coder.Constant function.
In the following code, gConstant is a global variable with constant value 42.
cfg = coder.config('mex');
globals = {'gConstant', coder.Constant(42)};
codegen -config cfg myfunction -globals globals
R2014a
Compatibility Considerations
Previously, for code using the AbortSet attribute, code generation succeeded, but the
behavior of the generated code was incorrect. Now, for the same code, code generation
ends with an error. Remove the AbortSet attribute from your code and rewrite the code
to explicitly compare the current and new property value.
C++
3-6
Language
The language selection and the standard math library selection determine the
available code replacement libraries.
In a project, the Code replacement library setting on the Hardware tab lists
available code replacement libraries. The MATLAB Coder software filters the list
based on compatibility with the Language and Standard math library settings
and the product licensing. For example, Embedded Coder offers more libraries and
the ability to create and use custom code replacement libraries.
In a configuration object, the valid values for the CodeReplacementLibrary
parameter depend on the values of the TargetLang and TargetLangStandard
parameters and the product licensing.
Compatibility Considerations
In R2014a, code replacement libraries provided by MathWorks no longer include
standard math libraries.
When you open a project that was saved with an earlier version:
The Code replacement library setting remains the same unless previously set
to C89/C90 (ANSI), C99 (ISO), C++ (ISO), Intel IPP (ANSI), or Intel
IPP (ISO). In these cases, MATLAB Coder software sets Code replacement
library to None or Intel IPP.
MATLAB Coder software sets the new Standard math library setting to a value
based on the previous Code replacement library setting.
If Code replacement library was set to:
3-7
R2014a
When you load a configuration object from a MAT file that was saved in an earlier
version:
The CodeReplacementLibrary setting remains the same unless previously set
to Intel IPP (ANSI) or Intel IPP (ISO). In these cases, MATLAB Coder
software sets CodeReplacementLibrary to Intel IPP.
MATLAB Coder software sets the new TargetLangStandard setting to a value
based on the previous CodeReplacementLibrary setting.
If CodeReplacementLibrary was set to:
C89/C90 ANSI
C99 (ISO)
The generated code can differ from earlier versions if you use the default standard
math library, C89/C90 (ANSI), with one of these code replacement libraries:
GNU99 (GNU)
Intel IPP (GNU)
ADI TigerSHARC (Embedded Coder only)
MULTI BF53x (Embedded Coder only)
To generate the same code as in earlier versions, change TargetLangStandard to
C99 (ISO).
After you open a project, if you select a code replacement library provided by
MathWorks, the code generation software can produce different code than in previous
versions, depending on the Standard math library setting. Verify generated code.
If a script that you used in a previous version sets the configuration object
CodeReplacementLibrary parameter, modify the script to use both the
CodeReplacementLibrary and the TargetLangStandard parameters.
3-8
R2014a
You must compile the code that is generated by the MATLAB Coder software on a target
that uses a twos complement representation for signed integer values. The generated
code does not verify that the target uses a twos complement representation for signed
integer values.
Compatibility Considerations
If you integrate code generated in R2014a with custom code that references TRUE or
FALSE, modify your custom code in one of these ways:
Define TRUE or FALSE in your custom code.
Change TRUE and FALSE to true and false, respectively.
Change TRUE and FALSE to 1U and 0U, respectively.
3-10
Compatibility Considerations
If you have C or C++ code that uses default structure type names generated from an
entry-point function in a previous release, and you generate the entry-point function
in R2014a, you must rewrite the code to use the new structure type names. However,
subsequent changes to your MATLAB code, such as adding a variable with a structure
type, can change the default structure type names in the generated code. To avoid
compatibility issues caused by changes to default names for structure types in generated
code, specify structure type names using coder.cstructname.
firhalfband
ifir
iirnotch
cl2tf
firlpnorm
iircomb
iirpeak
firceqrip
firminphase
iirgrpdelay
tf2ca
fireqint
firnyquist
iirlpnorm
tf2cl
firgr
firpr2chfb
iirlpnormc
dsp.DCBlocker
3-11
R2014a
im2uint16
imhist
bwpack
im2uint8
imopen
bwselect
imbothat
imref2d
bwunpack
imclose
imref3d
edge
imdilate
imtophat
getrangefromclass
imerode
imwarp
im2double
imextendedmax
mean2
im2int16
imextendedmin
projective2d
im2single
imfilter
strel
polyint
polyvalm
Signal Processing Toolbox
findpeaks
db2pow
pow2db
R2014a
3-14
3-15
R2013b
Version: 2.5
New Features
Bug Fixes
Compatibility Considerations
R2013b
Code generation for Statistics Toolbox and Phased Array System Toolbox
Code generation now supports more than 100 Statistics Toolbox functions. For
implementation details, see Statistics Toolbox Functions.
Code generation now supports most of the Phased Array System Toolbox functions and
System objects. For implementation details, see Phased Array System Toolbox Functions
and Phased Array System Toolbox System Objects.
adds a stack size option to the linker command line. See coder.updateBuildInfo.
4-3
R2013b
Compatibility Considerations
If you use the default configuration or project settings, the generated code has built-in
C types such as double or char. Code generated prior to R2013b has predefined types
from rtwtypes.h, such as real_T or int32_T.
Compatibility Considerations
If you select the pass structures by reference option, and a MATLAB entry-point function
has a single output that is a structure, the generated C function signature in R2013b
4-5
R2013b
differs from the signature in R2013a. In R2013a, the generated C function returns
the output structure. In R2013b, the output structure is a pass by reference function
parameter.
If you have code that calls one of these functions generated in R2013a, and then you
generate the function in R2013b, you must change the call to the function. For example,
suppose S is a structure in the following MATLAB function foo.
function S = foo()
If you generate this function in R2013a, you call the function this way:
S = foo();
If you generate this function in R2013b, you call the function this way:
foo(&S);
Compatibility Considerations
MEX functions generated in R2013b return a real value when a complex result has an
imaginary part equal to zero. MEX functions generated prior to R2013b return a complex
value when a complex result has an imaginary part equal to zero.
In R2013b, complex values with imaginary part equal to zero become real when passed to
an extrinsic function. In previous releases, they remain complex.
R2013b
4-8
4-9
R2013a
Version: 2.4
New Features
Bug Fixes
Compatibility Considerations
R2013a
5-2
5-3
R2013a
MATLAB algorithm since the previous build, saving you time during the verification
phase.
Compatibility Considerations
In previous releases, MATLAB Coder removed the constants from the MEX function
signature. To use these existing scripts with MEX functions generated using R2013a
software, do one of the following:
Update the scripts so that they no longer remove the constants.
Configure MATLAB Coder to remove the constant values from the MEX function
signature.
To configure MATLAB Coder to remove the constant values:
In a project, on the Project Settings dialog box All Settings tab, under Advanced,
set Constant Inputs to Remove from MEX signature.
At the command line, create a code generation configuration object, and, set the
ConstantInputs parameter to 'Remove'. For example:
cfg = coder.config;
cfg.ConstantInputs='Remove';
R2013a
Compatibility Considerations
If you open a MATLAB Coder project or use a code generation configuration object from
R2012b, the current version of MATLAB Coder software automatically tries to use the
toolchain approach. If an existing project or configuration object does not use default
target makefile settings, MATLAB Coder might not be able to upgrade to use a toolchain
approach and will emit a warning. For more information, see Project or Configuration is
Using the Template Makefile.
cumsum
factor
factorial
gcd
isprime
lcm
median
mode
nchoosek
nextpow2
primes
prod
To view implementation details, see Functions Supported for Code Generation
Alphabetical List.
In R2013a, MATLAB Coder ignores the initial property definition and uses the
reassigned type. In previous releases, MATLAB Coder did not support this reassignment
and code generation failed.
5-7
R2013a
Compatibility Considerations
In previous releases, if the reassigned property had the same type as the initial value
but a different size, the property became variable-size in the generated code. In R2013a,
MATLAB Coder uses the size of the reassigned property, and the size is fixed. If you
have existing MATLAB code that relies on the property being variable-size, you cannot
generate code for this code in R2013a. To fix this issue, do not initialize the property in
the property definition block.
For example, you can no longer generate code for the following function bar.
Class foo has a property prop1 which is a scalar double.
classdef foo %#codegen
properties
prop1= 0;
end
methods
...
end
end
This enhancement reduces code size and execution time. It also improves code
readability.
Compatibility Considerations
If existing configuration settings disable BLAS, MATLAB Coder now ignores these
settings.
Compatibility Considerations
Because Clang is the only compiler supported on Mac OS X platforms, and Clang does
not support Open MP, parfor is no longer supported on Mac OS X platforms.
MATLAB Coder no longer supports Watcom for standalone code generation.
Use Watcom only for building MEX functions. Use an alternative compiler for
standalone code generation. For a list of supported compilers, see http://
www.mathworks.com/support/compilers/current_release/.
R2013a
ispc
isunix
emlc
Errors in R2013a.
emlmex
Errors in R2013a.
Compatibility Considerations
emlc and emlmex have been removed. Use codegen instead. If you have existing code
that calls emlc or emlmex, use coder.upgrade to help convert your code to the new
syntax.
5-11
R2013a
5-12
R2012b
Version: 2.3
New Features
Bug Fixes
R2012b
Reduced data copies and lightweight run-time checks for generated MEX
functions
MATLAB Coder now eliminates data copies for built-in, non-complex data types. It also
performs faster bounds checks. These enhancements result in faster generated MEX
functions.
num2hex
strcmpi
strjust
strncmp
strncmpi
strtok
strtrim
upper
6-3
R2012b
R2012b
bwmorph
Interpolation and Computational Geometry
interp2
Trigonometric Functions
atan2d
dsp.IIRFilter
dsp.SignalSource
6-7
R2012b
6-8
R2012a
Version: 2.2
New Features
Compatibility Considerations
R2012a
Compatibility Considerations
If you use scripts to generate code and you do not want to use dynamic memory
allocation, you must disable it. For more information, see Controlling Dynamic Memory
Allocation.
On the Build tab, click the More settings link to open the Project Settings dialog
box.
For information about the parameters on each tab, click the Help button.
To view the updated dialog boxes for the code generation configuration objects:
1
At the MATLAB command line, create a configuration object. For example, create a
configuration object for MEX code generation.
mex_cfg = coder.config;
R2012a
open mex_cfg
For information about the parameters on each tab, click the Help button.
New Demo
The following demo has been added:
7-4
Demo...
coderdemo_reverb
7-5
R2011b
Version: 2.1
New Features
R2011b
For more information, see Diminishing the Size of a Matrix in the MATLAB
documentation.
8-2
8-3
R2011a
Version: 2.0
New Features
Compatibility Considerations
R2011a
-eg
-args
emlcoder.egc
coder.Constant
emlcoder.egs
coder.typeof(a,b,1) specifies a variablesize input with the same class and complexity
9-2
-F
-global
-globals
Note: -global continues to work with codegen
-N
-s
-config
Use with the new configuration objects, see
New Code Generation Configuration Objects
on page 9-4.
-T rtw:exe
-config:exe
Use this option to generate a C/C++ executable
using default build options. Otherwise,
use -config with a coder.CodeConfig or
coder.EmbeddedCodeConfig configuration object.
-T mex
-config:mex
Use this option to generate a MEX function
using default build options. Otherwise,
use -config with a coder.MexCodeConfig
configuration object.
9-3
R2011a
-T rtw
-T rtw:lib
-config:lib
Use either of these options to generate a C/C++
library using default build options. Otherwise,
use -config with a coder.CodeConfig or
coder.EmbeddedCodeConfig configuration object.
emlcoder.MEXConfig
coder.MexCodeConfig
emlcoder.RTWConfig
coder.CodeConfig
emlcoder.RTWConfig('grt')
The SupportNonFinite property is now available without an
Embedded Coder license.
The following property names have changed:
RTWCompilerOptimization is now
CCompilerOptimization
RTWCustomCompilerOptimization is now
CCustomCompilerOptimization
RTWVerbose is now Verbose
emlcoder.RTWConfig('ert')coder.EmbeddedCodeConfig
The following property names have changed:
MultiInstanceERTCode is now MultiInstanceCode
RTWCompilerOptimization is now
CCompilerOptimization
RTWCustomCompilerOptimization is now
CCustomCompilerOptimization
RTWVerbose is now Verbose
9-4
emlcoder.
HardwareImplementation
coder.HardwareImplementation
Compatibility Considerations
If your existing script calls emlc to generate code for a MATLAB function that has inputs
and does not specify the input types, and you migrate this script to use codegen, you
must modify the script to specify inputs.
The codegen Function Processes Compilation Options in a Different Order
In previous releases, the emlc function resolved compilation options from left to right so
that the right-most option prevailed. In R2011a, the codegen function gives precedence
to individual command-line options over options specified using a configuration object. If
command-line options conflict, the right-most option prevails.
Compatibility Considerations
If your existing script calls emlc specifying a configuration object as well as other
command-line options, and you migrate this script to use codegen, codegen might not
use the same configuration parameter values as emlc.
R2011a
coder.Constant
coder.EnumType
coder.FiType
coder.PrimitiveType
coder.StructType
coder.Type
Purpose
coder.config
coder.newtype
coder.resize
coder.typeof
New Demos
The following demos have been added:
Demo...
Hello World
Working with Persistent Variables Compute the average for a set of values by using
persistent variables
Working with Structure Arrays
Balls Simulation
R2011a
Demo...
Atoms Simulation
Kalman Filter
Compatibility Considerations
emlc
None
9-8
%#eml
Still runs
%#codegen
eml.allowpcode
Still runs
coder.allowpcode
eml.ceval
Still runs
coder.ceval
eml.cstructname
Still runs
coder.cstructname
eml.extrinsic
Still runs
coder.extrinsic
eml.inline
Still runs
coder.inline
eml.nullcopy
Still runs
coder.nullcopy
eml.opaque
Still runs
coder.opaque
eml.ref
Still runs
coder.ref
eml.rref
Still runs
coder.rref
eml.target
Still runs
coder.target
eml.unroll
Still runs
coder.unroll
eml.varsize
Still runs
coder.varsize
eml.wref
Still runs
coder.wref
9-9
R2011a
9-10