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 396821

Submitted on 4 Feb 2014 by andrea84

Correct

47Size
Leading solution size is 13.
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
 
%%
%
% Non Reg Exp way of doing it
%
sourceCode=urlread('http://www.news.google.com');
startInd=strfind(sourceCode,'<span class="titletext">');
headline=sourceCode(startInd(1)+24:startInd(1)+150);
headline=headline(1:strfind(headline,'</span>')-1)
%
%
assert(isequal(getTheNews,headline))
headline =
Obamacare will shrink workforce by 2 million, report says
headline =
Obamacare will shrink workforce by 2 million, report says