30 - CS1371Recitation 9/30/08 Miniquiz:...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 1371 Recitation 9/30/08 Mini-quiz: fh = fopen('encyclopedia.txt', 'r'); count = 0 txt = fgetl(fh); while ischar(txt) count = count + 1 txt = fgetl(fh); end fclose(fh) ----------------------------------- load/save x.mat load x save y ----------------------------------- xlsread xlswrite dbl cell cell [num, txt, raw] = xlsread(filename) Nan = not a number raw = everything so dimensions are correct txt = strings in xls and empty strings ' ' if number or not string str(char) xlswrite(filename, cA) -------------------------------------- function xlsParse(filename) [num, txt, raw] = xlsread(filename); for i = 1:numel(raw) if raw{ i } == 9 raw{ i } = 'silly'; end end
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
xlswrite(['new', filename], raw) ---------------------------------- (str) csvread(filename) dlmread(filename, dlm) num = csvread('y.csv'); num = [1 2 3 4 5 6] dlmread('y.csv', ' , ') ----- delimits by things separated by a comma (tab = ' \ t ') dlmwrite csvwrite str numerical array csvwrite(filename, numarr) dlmwrite(filename, numarr, dlm)
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/20/2008 for the course CS 1371 taught by Professor Stallworth during the Spring '08 term at Georgia Institute of Technology.

Page1 / 3

30 - CS1371Recitation 9/30/08 Miniquiz:...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online