Week 3 Food Web MATLAB Example

MATLAB is another popular script-driven computing environment for doing ocean science data analysis. Below is an example of doing MATLAB work, using the classroom activity on September 20th as an example. Compare the MATLAB script with the Python script we wrote to do a similar analysis. The MATLAB script is here:

The commands are similar to the Python commands we ran but in the MATLAB case, all loaded modules are available to the script. I determine which modules load when I launch the MATLAB program. I probably have overdone it as MATLAB takes about forty seconds to load as a result of all the modules it readies at launch time. I am only using about 2% of them in the script. As I run the script within MATLAB, I can run one line at a time (like the control we have over the Jupyter notebook). After each line runs, the command window shows the result. Every variable's content is shown in its entirety after each assignment or mathematical operation (internally, MATLAB treats each variable as a matrix). For example, after I run line 21, the command window shows me:



The plotting interface in MATLAB is straight-forward and similar to the Matplotlib services interface in Python.