wordCount - while ~isempty(rest) [tk rest]= strtok(rest)...

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

View Full Document Right Arrow Icon
Sheet1 Page 1 function numwords=wordCount(string) fh=fopen(string,'r') words='' count=1 while ischar(words) words=fgets(fh) [tk rest]= strtok(words)
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(rest) [tk rest]= strtok(rest) count=count+1 end end numwords=count fclose(fh)...
View Full Document

Ask a homework question - tutors are online