Import excel to matlab
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I want to import data from excel into matlab. My data is separated into different sheets and I would like to save each sheet into its own variable (it is important that the sheets stay separated, I don't just want to import all the data into a single variable). Does anyone know how to do this?
0 Kommentare
Antworten (1)
Chirag Gupta
am 18 Jul. 2011
[~, sheets, ~] = xlsfinfo('myfile.xls'); gives a cell array of sheets
for i = 1:length(sheets)
%create variable string
varname = genvarname('data_' sheets{i});
eval('varname = xlsread(''mytest.xls'',sheets{i})');
end
3 Kommentare
Siehe auch
Kategorien
Mehr zu Data Import from MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!