Practice: Files and Directories

Time to practice working with files and directories.

Contents

Setting Up

Make sure you've grabbed and extracted the zip file here.

Problem 1

  1. Change directory to exampledir.
  2. What's contained in it?
  3. Find out what's contained in any subdirectories.
  4. Use mkdir to add a subdirectory to exampledir.

Problem 2

  1. Load practice.mat.
  2. What does it contain?
  3. Make variables containing all the reaction times (rt), trial start times, and payouts contained in data.
  4. Save these three variables to a new .mat file called extracted.mat.

Problem 3

Use copyfile to copy extracted.mat to the subdirectory of exampledir you created in Problem 1.