1

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

Shai
  • 111,146
  • 38
  • 238
  • 371
Bonk
  • 1,859
  • 9
  • 28
  • 46

2 Answers2

2

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/".

EwyynTomato
  • 4,009
  • 1
  • 31
  • 39
0

If you have access to matlab, the best thing to do would be to run the following commands and have a look at the results:

help load
help which
which T
help T
which Lon
which Lat

Running these commands should tell you:

  1. What Load does
  2. What which does
  3. Where T is
  4. What T does
  5. Where Lon is
  6. Where Lat is
grantnz
  • 7,322
  • 1
  • 31
  • 38