MATLAB Code Converter

Making Code Conversion Merely One Click Away

Most developers who have experienced the efficiency and convenience of MATFOR will find its syntax similar to that of Matlab. This, however, should not be a surprise to anyone since the inventors of MATFOR deliberately adopted the MATLAB-like calling concept to shorten its learning curve. To further ensure an easy migration from MATLAB to MATFOR, the development team of MATFOR have created a code converter, which can save developers hours of painstaking effort doing manual conversions.

MATLAB Code Converter started as a rough and small online tool that could only convert between MATLAB and the two languages supported by the earlier versions of MATFOR. In November 2006, a month after the release of MATFOR in VB and C#, the MATFOR development team promptly expanded MATLAB Code Converter's features to encompass the support for VB and C# conversions, making it a handy tool that converts MATLAB code into Fortran, C++, VB and C# code. The converter discreetly translates MATLAB syntax into MATFOR syntax, and precisely converts MATLAB matrices into mfArray, a MATFOR-defined advanced dynamic array, to allow automatic data typing and dimensioning in different programming environments.


Figure 1. Demonstration of MATLAB Code Converter

MATLAB Code Converter has been a part of the free online services on AnCAD's website; it is currently located at http://www.ancad.com/codeConverter.php. On the top of the code converter page, there are five buttons, demonstrating five example cases arranged in an order of increasing complexity. These demo cases are carefully prepared by AnCAD's engineers to assist users in acquiring offhand experiences more quickly.

To use the demo,
Step 1. Select the desired language to be converted to.
Step 2. Click on the button of the desired demo case, the conversion result will automatically be displayed in the right dialogue-box.

The following is a walk-though for the conversion of MATLAB to C++ on demo case ¡§Function¡¨.
Step 1. Select C++ as the language to be converted to.
Step 2. Click on Function to see how MATLAB function calls may be converted into MATFOR in C++ function calls.

Users may also enter their own MATLAB code into the left dialogue-box and hit Translate to proceed the conversion. After the conversion takes place, users may copy the output code to their programs. Before compiling the programs, one must confirm that
1) MATFOR has been properly installed with a valid license,
2) header files have been appropriately included in the program, and
3) mfArray has been correctly initialized.

C++

FORTRAN

VB
C#

#include ¡§fml.h¡¨
#include ¡§fgl.h¡¨
mfArray a;

use fml
use fgl
type(mfArray):: a

Imports MatforNet
Dim a as mfArray

using MatforNet;
mfArray a;



Please note that there is a 4069 bytes size-limit to the code of each conversion as the conversion is processed through the internet. Many developers found this online service helpful and had thus conveniently dumped an enormous chunk of code to the converter at once, this may crash the system, and the user may not receive any conversion results. We strongly recommend users to convert programs piece by piece in order to get the best result. If you find any feature that needs to be extended or enhanced, please inform support@ancad.com .

Try MATLAB Code Converter now!