Share |
Login Form
Newsletter



Receive HTML?

Latest Members


Compiling MATLAB Applications

 
User rating
 
0.0 (0)

At different levels of abstraction, MATLAB can be seen as either

       i.            Either a software

       ii.            Or a programming language incorporated into (i)

All commands and functions typed in MATLAB command window are in the MATLAB language.

            The key point to keep in mind is the fact that MATLAB is an interpreted language – it's not a compiled one. Where one might argue in favor of one or the other, there are a few points to keep in mind.

  1. Compiled languages are free of errors (except for run-time errors!) as the compiler removes them at compile-time.
  2. The development cycle for a program written in a compiled language is longer.
  3. Type checking is easily enforceable in compiled language.
  4. Scripting/Interpreted languages take a longer time to ‘execute’.

 All of these points might make one conclude that MATLAB applications should be compiled ones. After all, they’ll be faster, error-free, and highly optimized (for-loops are very ‘costly’ in an interpreted language). However, one of the basic tasks of a compiler is to reserve memory for variables. That is, it must know the type and size of variable that has been used.

            Employing that feature is MATLAB might take out a number of the pros of using MATLAB as a tool that we know today. For instance, in MATLAB, users use variables without declaring them, and constantly 'reshape' them via concatenation or some other operation. All this happens without the user not knowing them. In a compiled language, it would have been very difficult (or inefficient) to do so. As an example, in Visual Basic, Microsoft specially provided a StringBuilder class to deal with strings where programmers need to concatenate strings, or characters, and stress the fact that the use of the regular ‘String’ class will degrade performance if used in such a scenario.

            The MATLAB does this is through its runtime environment, similar in philosophy to the .NET one, which takes care of memory management and other stuffs.

            Does it mean that MATLAB programs can’t be compiled at all? Well, it can! MATLAB provides a compiler that can be used to ‘deploy’ MATLAB applications. However, one of the following conditions needs to be met.

  1. MATLAB needs to be installed on the target PC.
  2. The MATLAB runtime must be deployed along with the application.

             The tool itself is very easy to use. The MATLAB webinar ‘Application Deployment using MATLAB’ provides an example of the procedure.

            There are a few limitations (very few!) of the tool, most of them what users will never face in ordinary situations. For specific issues, please comment on this article so others can know about them as well.

User reviews

There are no user reviews for this listing.

To write a review please register or login.
 
 
 
Written by :
Muhammad Maiz Ghauri
 
 






Latest Content
User rating
 
0.0 (0)