MATLAB has a number of great features that engineers and scientists can use to model systems, analyze data, and verify designs. What's great about it is that non-programmers can pick it up quickly and use it to solve complex problems. There is an immense library of builtin functions and optional toolboxes that solve most common problems, and creating a new simulation is typically as easy as cobbling together these existing pieces. Here are a list of features that I think engineers appreciate:
- Data Types: Matrices and vectors are really the fundamental units of data. Because of this, they are easy to define and use. Variables are all dynamically typed. "Polymorphism" (i put it in quotes because it is not true polymorphism as most people know it) is handled inside the functions themselves, so for most operations the size and type of operands can be safely ignored.
- Do What I Mean: Most functions are vectorized. This means that if I pass in a vector to a function instead of a scalar, the function will loop over all elements of the vector, as should be expected. Functions are all global. Engineers don't want to worry about namespaces or libraries. We want everything right here, right now, whether we are using it or not. We want to be able to call a function without having to search the documentation for where it's located.
- Do Everything: MATLAB is a complete environment, and once you enter, you will never need to leave. It's got file browsers, a command prompt with command history, an integrated editor, integrated everything. You can dock everything together, so the things you want can stay where you want them. MATLAB has commands to interface with the system shell. All you need to do is type an exclamation point, and everything following it is passed to the shell. MATLAB comes bundled with Perl too, so if you need that, BAM! there it is. You can program MATLAB in C, C++, FORTRAN and Java, if you have legacy code lying around, or if you can't be bothered to learn M script. MATLAB does everything, so we don't need to worry about bringing together a whole collection of programs, or worrying if our multiple software tools are going to interoperate properly.
- Proper Object Oriented Features: MATLAB has object-oriented programming capabilities, but they are far from what most programmers would know as being "standard" practice. I would like to see MATLAB's object system be given a complete overhaul. Much of this could be done with simple source filtering, if modifications to the parser would be too difficult. Saying "x.field = 5" is much easier and more intuitive then having to say "x = set(x, 'field', 5)". This illustrates another point too: It would be nice if complex objects could be passed by reference instead of passing everything by value. A different calling syntax using the "." notation would help to make this difference explicit.
- Namespacing: Even if it was optional, and even if most things were in the main namespace by default, I would still like to see a robust namespacing system implemented. This way, we could allow overloading of common function names like "size" or "length". Keeping most things global by default keeps the convenience factor high for most users, but allowing namespacing would be a handy extra bit of flexibility for more advanced users.
- Threading: I know this is a common complaint, but I would love to see a multi-threaded version of MATLAB.
- Code Embedding: This is a relatively minor wish, and it probably wouldn't affect too many people, but considering how MATLAB supports interfaces with several other programming languages, I would like to see some kind of ability to directly embed code written in other languages into MATLAB script files. Some sort of directive, like "IN_M", or "IN_FORTRAN" that would tell the interpreter to compile the following block before executing it, would be really handy. Having to write code into separate files, compile them individually, and then write M functions to interface with them seems like a lot of work considering MATLAB's level of integration.