Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solution 293292

Submitted on 31 Jul 2013 by Richard Zapor

Correct

11Size
Leading solution size is 9.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Pass
 
%%
% Cody External accessibility
% This file may need to change in the future
% First test -- read in coffee file
%in_f='https://www.cs.drexel.edu/~bchar/data1.txt';
%in_f='http://www.cnn.com';
%in_f='http://example.iana.org/';
in_f='http://history.eserver.org/gettysburg-address.txt';
out_f='data1.txt';
urlwrite(in_f,out_f);
s=dir(out_f)
assert(strcmp(s.name,out_f))
%assert(s.bytes==1643);
result1 = textCount1(out_f);
assert(length(result1)==2);
countE=result1(1)
assert(countE==5)
%countE1Correct = 468
%countWords1Correct= 731
%assert(isequal(countE, countE1Correct));
%assert(isEqual(countWords, countWords1Correct));
s =
       name: 'data1.txt'
       date: '31-Jul-2013 19:29:43'
      bytes: 1910
      isdir: 0
    datenum: 7.3545e+05
countE =
     5