CIEG 675 IN CLASS EXERCISE ON STRCUTURES - PowerPoint PPT Presentation

1 / 1
About This Presentation
Title:

CIEG 675 IN CLASS EXERCISE ON STRCUTURES

Description:

I also want to make a huge structure with all the data. ... load(m(k).name); % load each file. newfname=strtok(m(k).name,'.'); % remove .mat extension ... – PowerPoint PPT presentation

Number of Views:17
Avg rating:3.0/5.0
Slides: 2
Provided by: CEE1
Category:

less

Transcript and Presenter's Notes

Title: CIEG 675 IN CLASS EXERCISE ON STRCUTURES


1
CIEG 675 IN CLASS EXERCISE ON STRCUTURES
Suppose I have an unknown number of beach
profiles all saved as individual matlab files in
the directory /home/profiles. Each file contains
the variables x and z. I want to print plots of
each profile so I can put in my notebook and save
the plots to the directory using the filename of
the file (minus the extension). I also want to
make a huge structure with all the data. The
structure should contain the filename and the
data. Write the commands to do this. m
dir(/home/profiles/.mat) get directory of
filenames start loop for k1length(m)
load(m(k).name) load each file
newfnamestrtok(m(k).name,.) remove .mat
extension data(k).namenewfname new
data structure being created
data(k).xx x data data(k).zz z
data make plot plot(x,z)
print send current figure to screen
really should dress it up first though
txtsprintf(print djpeg /home/profiles/s,newf
name) string for saving plot
eval(txt) evaluate the string txt
clf clear figure for next go round end
end k loop
Write a Comment
User Comments (0)
About PowerShow.com