Notes on Code Translation to MATLAB(R)
This help page describes details particular to code translation using the CodeGeneration[Matlab] function. For general information applicable to all the functions in the CodeGeneration package, see CodeGenerationDetails.
<Text-field style="Heading 2" layout="Heading 2" bookmark="info">Description</Text-field>
The MATLAB\302\256 code generated by CodeGeneration[Matlab] is valid for MATLAB\302\256 version 6.5 (R13).
In addition to the functions listed on the CodeGenerationDetails help page, the following Maple functions are recognized by CodeGeneration[Matlab]: cat, ceil, and floor.
Generally, math functions recognized by CodeGeneration[Matlab] are translated to native functions in the MATLAB\302\256 library. Additionally, the Maple symbol Pi is translated to the constant pi.
CodeGeneration[Matlab] translates printf statements to Print calls, but performs only limited analysis of the printf format string. Thus some formatting instructions (for example, precision for floats) are ignored in translation.
Although MATLAB\302\256 6.5 allows longer identifiers, the translator renames identifiers longer than 31 characters to ensure compatibility with older versions of MATLAB\302\256.
Any try/catch/finally clause in the original code is translated to a MATLAB\302\256 try/catch block; if more than one catch is present in the Maple input, the catch clause in the MATLAB\302\256 output will have a series of if statements, testing the value of lasterr.
The equivalent of a Maple module in MATLAB\302\256 is a directory. Procedure module members correspond to LUklbXJvd0c2JEkqcHJvdGVjdGVkR0YlL0krbW9kdWxlbmFtZUc2IkksVHlwZXNldHRpbmdHNiRGJUkoX3N5c2xpYkdGKDYkLUkjbW9HNiRGJS9GJ0YpNiNRIi5GKC1JI21pRzYkRiUvRidGKTYjUSJtRig= files in this directory hierarchy. All procedures are printed in sequence in the result of the MATLAB\302\256 command; comments indicate the appropriate place to put a piece of code in this directory hierarchy. Procedures that are exported module members are translated preceded by a comment "modulename/procedurename.m:", while those that are local module members are translated preceded by a comment "modulename/private/procedurename.m:". Module local variables that are not procedures are declared as globals.
See AlsoCodeGenerationCodeGeneration[Matlab]CodeGenerationDetailstrademarks