% Sample file to import Excel data into Matlab using the
% cell2table and writetable commands

clear

% Sample Excel data file

% Name  	Country  	Completed  	 Length (m) 
% Mackinac	United States	1957	8038 
% Xiasha	China	1991	8230 
% Virginia-Dare-Memorial	United States	2002	8369 

% Read the complete Excel file (previous exercise)

[num,txt,raw] = xlsread('bridges_of_the_world_short.xls','Bridge data');

% Convert the Cell Array "raw" to a Matlab Table format

myTable = cell2table(raw);

% Read the Excel file specifying columns and rows to read

writetable(myTable,'exportToExcel.xls')    % writes to an Excel file
