excel - Matlab: writing multiple tables with cell2table -



excel - Matlab: writing multiple tables with cell2table -

i write multiple tables in matlab loop. input utilize excel file contains multiple sheets. yhe amount of sheets , size of info not prefixed. reading of files goes right 1 time save table overwrites same table on , on again.

the clue flexible name in cell2table function. have these names in sheetname (all) , sheet (current). has suggestion?

[type,sheetname] = xlsfinfo('\matlab\dienstregeling.xlsx'); m=size(sheetname,2); for(i=1:m); sheet = char(sheetname(1,i)); [num, text, raw] = xlsread('\matlab\dienstregeling.xlsx',sheet); test = cell2table(raw); end

you utilize construction , generate field names variable sheet:

test = struct; for(i=1:m); sheet = char(sheetname(1,i)); [num, text, raw] = xlsread('\matlab\dienstregeling.xlsx',sheet); test.(sheet) = cell2table(raw); end

excel matlab

Comments

Popular posts from this blog

php - Edges appear in image after resizing -

ios8 - iOS custom keyboard - preserve state between appearances -

Delphi change the assembly code of a running process -