wordCount - while ~isempty(tok) [tok rest] = strtok(rest,'...

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

View Full Document Right Arrow Icon
function num = wordCount(fn) fh = fopen(fn,'r'); line = fgetl(fh); num = 0; while ischar(line) [tok rest] = strtok(line,' ');
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: while ~isempty(tok) [tok rest] = strtok(rest,' '); num = num + 1; end line = fgetl(fh); end...
View Full Document

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

Ask a homework question - tutors are online