To read a velocity model from a .nd file, execute
model=mkreadnd(pfad);
where pfad is the complete path and filename of the file you wish to read.
The above command will write some control output to the screen: (basepath is a string containing some path, filesep is a MatLab function which returns the separator character '/' or '\', depending on the platform):
>>prem=mkreadnd([basepath filesep 'prem.nd']); MKREADND: discontinuity: mantle at 24.4 km MKREADND: discontinuity: LVZ at 220 km MKREADND: discontinuity: Transition Zone at 400 km MKREADND: discontinuity: Lower mantle at 670 km MKREADND: discontinuity: outer-core at 2891 km MKREADND: discontinuity: inner-core at 5149.5 km MKREADND: non-standard discontinuity: lvz MKREADND: planet radius is 6371 MKREADND: 6 discontinuity names. MKREADND: 88 parameter sets. MKREADND: 105 lines total. >>
The variable prem is now a model (see section on model structures for description) structure which contains parameters of a discretized version of the PREM model by Dziewonski & Anderson (1981).
To suppress the screen output (which could be very annoying when you use MKREADND within a programm that reads many model files), call
model=mkreadnd(pfad,'silent');