10-8 Recitation Notes - xlswrite-inputs: [name of file,...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 Examples: 1-Average Final Exams High Level File IO: save function saves everything in the workspace load then loads everything that was saved dlmread() -takes in a file and a delimitor -creates a double array -can only be used for numerical data dlmwrite('filename.txt', array{2:2:end}, '.') -new file, array to be written, new delimitor csvread and csvwrite are specialized versions of dlmread -assummed to have a ',' as the delimitor *ALL INPUTED ARRAYS MUST BE ARRAYS OF DOUBLES xlsread -3 outputs: [all numerical data, all text data, all data] --[num text raw] --Outputed as a double, a cell array, and a cell array
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: xlswrite-inputs: [name of file, cell array] Low Level File IO: fid = fopen(filename,purpose) purpose: r-read, w-write, a-append to read through the file: fgets(fid) - returned first line in the file with the line ender fgetl(fid) - returns the next line, but without the line ender (most commonly /n)-if you try to run it after the end of the file, '-1' is outputed to read words in each line: [token rest] = strtok(line, ' ')-saves up to the first delimitor as a token-saves the rest of the line as a string write text to a file: fprintf(fid)-writes the text to a file fclose(fid)-closes file...
View Full Document

This note was uploaded on 08/28/2011 for the course CS 1371 taught by Professor Stallworth during the Fall '08 term at Georgia Institute of Technology.

Ask a homework question - tutors are online