MATLAB is a high level computing environment from MathWorks. Its name is short for Matrix Laboratory. It was originally a system for solving matrices — quickly and accurately. But in its over three decades of existence, it has grown greatly to become a general environment for solving scientific and engineering problems.
What Can MATLAB Do?
Although at its base, MATLAB is still a system for solving linear algebra problems, an enormous amount has been built on top of this. Here are just a couple of cool things from the MATLAB Examples pages:
- Data Acquisition: by simply dragging and dropping components, it is possible to take data from a connected device, process it, and output it in a user friendly form.
- Differentiation: using the Symbolic Math Toolbox, MATLAB can perform calculus and many other forms of mathematics.
- RNA Structure: this is an application that predicts and displays the structure of RNA based on its sequence.
- Face Detection: this is just one of many face detection algorithms. MATLAB is used especially widely in image processing.
How Does MATLAB Work?
MATLAB uses its own development environment. Most people simply work inside of it. It uses its own proprietary language. However, it can be used with external programs and functions in languages like C++ and Fortran. What's more, applications that you create inside of MATLAB can be output to the C programming language so that they can be included in outside programs.
Regardless of all the bells and whistles, however, MATLAB is still at base about linear algebra. It thinks in terms of matrices. And the MATLAB scripting language shows this.
x = 15.7, it knows that x is a floating point number. On the other hand, if you tell it
x = 'help' it knows that x is a string. If you start using numbers like strings or vise versa, then it will deal with them on the binary level, much like Perl.
You can manipulate variables the same way you can in any programming language. Similarly, strings are really arrays of characters and can be managed thusly.
The real power of MATLAB is in its easy manipulation of matrices. A matrix is defined within square brackets with columns separated by spaces and rows by semicolons. Here is a simple example from the MATLAB documentation:
A = [1 1 0 0];
B = [1; 2; 3; 4];
C = A*B
The first line defines a 1-by-4 A matrix. The second line defines a 4-by-1 B matrix. By basic matrix algebra, we know that the result is: 1*1 + 1*2 + 0*3 + 0*4 = 3. Obviously, far more complicated calculations can be performed.
In addition to all the mathematical tools that MATLAB offers, there are many additions to it. In particular, there are toolboxes. We've already mentioned the Symbolic Math Toolbox. But there are many others in various areas:
- Parallel Computing
- Math, Statistics, and Optimization
- Control Systems
- Signal Processing and Communications
- Image Processing and Computer Vision
- Test and Measurement
- Computational Finance
- Computational Biology
As you can see, the uses that MATLAB is put to are broad, and they provide specialized tools for all of them.
MATLAB is a relatively expensive product. The price for the base program is over $2,000. Simulink is $3,000 extra. And toolboxes are $1,000 minimum, and often much more. Generally, people use MATLAB under two circumstances. First, it is used in academia a great deal. As a result, MathWorks offers student versions of MATLAB and Simulink for less than a hundred dollars.
The second way people normally get access to MATLAB is through their employers. MATLAB is so powerful that it is often easily worth its price.
Free MATLAB Alternatives
There is no free version of MATLAB. However, there are two free alternatives to it. These are both powerful tools that will at very least provide you with an easy way to get started in the right direction.
- GNU Octave: this is a graphical computational environment similar to MATLAB that is generally compatible with it, and is designed to be completely compatible.
- Scilab: this is similar to Octave, although without as much focus on compatibility with MATLAB.
There are a lot of online resources to help you learn MATLAB. But we recommend that you start with a book. What can ultimately be done with MATLAB is so vast that it is good to get a thorough overview of the subject.
The following are all very good basic introductions to MATLAB.
- MATLAB For Beginners: A Gentle Approach by Peter Kattan: this is a short and clear introduction to MATLAB. It's an excellent place to start.
- Essential MATLAB for Engineers and Scientists: this is a good and slightly more in-depth introduction to MATLAB.
- MATLAB For Dummies by Jim Sizemore and John Paul Mueller: part of a venerable and predictably good series of books.
- Matlab: A Practical Introduction to Programming and Problem Solving by Stormy Attaway: this is a textbook, but an easily understood and thorough one with lots of examples.
- Getting Started with MATLAB: A Quick Introduction for Scientists and Engineers by Rudra Pratap: a short but surprisingly thorough introduction to MATLAB with an emphasis of scientific programming.
- MATLAB: An Introduction with Applications by Amos Gilat: a textbook that is a good introduction to the subject. Because it is older, you can generally find it at a low price.
Because of MATLAB's use at academic institutions, there are a lot of free tutorials that will get you started.
- Learn with MATLAB and Simulink Tutorials: MathWorks' own basic MATLAB tutorials.
- Kelly Black's MATLAB Tutorial: this is a fairly narrow tutorial, but it goes into a good deal of depth about the basics.
- University of Utah MATLAB Tutorial: a quick and dirty introduction to MATLAB in one short page. See also the more detailed, MATLAB Basics and a Little Beyond.
- MATLAB Hypertext Reference: this is quite a detailed introduction to MATLAB.
- Software Carpentry: MATLAB Tutorial for Beginners: this is a 12-part video series on the basics of MATLAB — about 2 hours in total.
- MATLAB Tutorial: this is another video tutorial, but consisting of 100 short tutorials.
Other Online Resources
Here are a few resources for once you learn the basics of MATLAB:
- Helpful Information For Using MATLAB: this is a small, but useful, collection of MATLAB resources, including an FAQ.
- MATLAB Wiki FAQ: this is quite an in-depth FAQ that can even be used as a kind of tutorial, if you know the very basics.
- A Partial List of On-Line Matlab Tutorials: although it does have a list of some tutorials, this Duke University resource includes some great examples of MATLAB programming.
MATLAB doesn't have the kind of user base that, say, C++ has. But there is still a very active community of coders. As always on forums, be aware that spam gets through. But all of these are solid forums.
- MATLAB Answers: this is the MathWorks community forum where you can ask questions and look for answers.
- MATLAB Subreddit: this is the very active MATLAB forum on Reddit. You might also find the math subreddit useful.
- Stack Overflow: when it comes to just about anything computer related, Stack Overflow is the place. This link takes you to all the discussions that have been taged as having to do with MATLAB.
- <dream.in.code> Other Languages: this is not specific to MATLAB, but it is very active with a lot of knowledgeable people around.
- Drexel University Forum: this is the MATLAB section of their Math Forum. It's very active, but obviously with an academic bent.
MATLAB is a high level computing environment used throughout academia and in industries as varied as physics and finance. We've only touched on its capabilities here. With these resources, you can start learning the system. It could eventually take you just about anywhere.