Miscellaneous

Programming for N00bz: MATLAB

Note: This article is hosted here for archival purposes only. It does not necessarily represent the values of the Iron Warrior or Waterloo Engineering Society in the present day.

Hello readers, I’m here to present you with a brand new column, Programming for N00bz. The goal of this column is to try to explain to non-programmers many of the programming languages they or their friends could encounter during their university career. Furthermore, these articles will attempt to clear up many of the “What in the world are you talking about” questions that arise when many non-programmers hear programmers talk about school, jobs or side projects.

This week, I’m going to be exploring one of the most commonly used programming languages at the University of Waterloo, Matrix Laboratory, also known as MATLAB. MATLAB is a programming language that pretty much all engineers will have exposure to at one point or another. Specifically, Chemical and Nanotechnology engineering students take it in first year, Electrical and Computer Engineering students take it second year and Software Engineering students take it on many technical electives. Outside of engineering, almost all math and many science students will have exposure to the language as well.

So now that we’ve covered who uses MATLAB, the question of what it is exactly arises. According the MathWorks, the developer of MATLAB, “MATLAB® is a high-level language and interactive environment that enables you to perform computationally intensive tasks faster than with traditional programming languages such as C, C++, and FORTRAN.” In less technical terms, MATLAB is a programming language that allows the user to more efficiently compute the results of complex mathematical equations than many other programming languages.

So now the question is, “why do we learn MATLAB” and/or “why should you learn to use it?” MATLAB is one of the most important programming languages that engineers can learn because of its ability to handle extremely complex mathematical calculations. As a result, many of the simulations that engineers run can be programmed in MATLAB. This makes learning MATLAB a huge benefit to any engineer, mathematician or scientist that needs to conduct a simulation or complex calculation before building a prototype and/or doing an experiment. For example, one of the more well-known first year math lecturers, Eddie Dupont, extensively used MATLAB to perform extremely complex integrals. There are also many other cases of current and former faculty members using MATLAB in their research at the university.

All of us, at one point or another, have had to take linear algebra and deal with matrix arithmetic. MATLAB has built in functionality to easily handle all of those horribly tedious and complicated calculations required to do everything from finding the determinant of a matrix to row reducing stupidly large matrices.

One of the other cool features of MATLAB is its ability to produce a graphical representation of functions. You may be thinking, “Wolfram Alpha does this for me without having to program anything.” However, Wolfram Alpha has limitations to how complex of a function it can graph and even calculate. MATLAB will graph pretty much all functions that you can throw at it and is a good tool for checking if you properly calculated the integral of some nasty function.

Another benefit of using MATLAB is that it is not platform specific. In other words, it doesn’t matter if you are working on a Mac, PC or even Linux; MATLAB works on every single one of them. Moreover, MATLAB interfaces with many other commonly used languages such as C and Java (both of which will be covered in later articles). This allows users to pull in other features that MATLAB does not include and/or support while making it more accessible to those that know other programming languages.

So to conclude, MATLAB is one of the most important programming languages that engineers, mathematicians and scientists can learn because of its ability to perform complex mathematical equations in an extremely efficient manner. Furthermore, MATLAB provides many tools to make calculations easier and can provide a visual output for complex functions. Hopefully MATLAB is a little more accessible and a little less frightening after reading this article. Moreover, I hope many of the confusions surrounding the programming language have been resolved making many of your courses more enjoyable.

Stay tuned for next week’s column on Visual Basic.

Leave a Reply