Code covered by the BSD License  

Highlights from
Get HTML Table Data into MATLAB

image thumbnail

Get HTML Table Data into MATLAB



16 Dec 2008 (Updated )

Identify tables and interactively select the data to bring into MATLAB.

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

%% Get data from an HTML table straight into MATLAB
% Copyright 2008 - 2010 The MathWorks, Inc.

%% Navigate to a webpage with a table 
% You have to use the MATLAB browser because this takes advantage of the
% matlabcolon (matlab:) protocol.
% give it time to load the page
%% Call the function to grab the data
%% Updated Browser
% This shows what the browser looks like.  This is just a screenshot but it
% would be whatever page you are on with MATLAB icons next to tables.
im = imread('mlPage.jpg');
%% Select the table 
% You can select the table interactively by clicking on the MATLAB icon or
% passing a number to the getTableFromWeb function.  I have selected to get
% the Valuation Measures
myTableData = getTableFromWeb(8)

Contact us