generateCode
Generate C code to run kinematic analysis on KinematicsSolver object
Syntax
Description
generateCode(
creates a standalone
MATLAB® function that is equivalent to the
ks
)solve
function, but supports code generation.
It also creates a directory called ModelName
_codegen_kinematics that
contains all the source files for the code generation in the current directory, where
ModelName
is the output string of
ks.ModelName
.
The created MATLAB function is called ModelName
_solveKinematics and
has the same signature as the solve
function:
[outputs,statusFlag,targetFlags,targets] = ModelName_solveKinematics(targets, initialGuesses)
Once generated, the function is completely independent from the original object and will
not reflect any changes to the object. You can generate MEX functions, static libraries
(LIB), and dynamics libraries (DLL) from MATLAB code that contains the
ModelName
_solveKinematics function by using the
codegen
function, which requires a MATLAB
Coder™ license.
Note
ModelName
_solveKinematics is not meant to be invoked from MATLAB
and an error occurs when calling it directly from the MATLAB command line or a MATLAB
file. However, you can call this function directly from a MATLAB Function block in a
Simulink model.
Examples
Input Arguments
Version History
Introduced in R2019a