matlabmatlab-load

what happens when you load a directory?


I am trying to learn some simple matlab code posted by my professor, and the first line goes somehting like

load /class/mat121/lab1/data

I've never seen "load" used like this before, what does it do? does it load all .m files in the directory?

I also see a lot of custom functions in the code, such as "T()", "Lon()", "Lat()" etc, they aren't standard matlab functions therefore I am assuming they are imported from that directory?

thanks


Solution

  • Title is incorrect, because "data" is not directory.

    You can refer to load function.

    Anyway,

    /class/mat121/lab1/
    

    this should be the directory path

    data
    

    this should be a file called "data.mat" which contains matlab workspace variable that is previously saved with save function.


    So,

    load /class/mat121/lab1/data
    

    loads workspace variables from "data.mat" which is located under "/class/mat121/lab1/".