Hi,
I've created a code (see below), which successfuly so far enables me to access each subjects excel file, then each sheet within that excel file. Each subject has a varying number of sheets within their Excel file, with the first sheet for each subject always named 'Summary', then the sheets are named Trial1, Trial2, Trial3 etc.... each sheet represents a seperate trial.
I wish to use the data from each individual sheet, then put them into a struct which is named gait analysis report, then which subject number they are and finally which sheet it is.
So it may look like: GaitAnalysis Report - Subject1 - Trial 1 - Data for trial
The SheetData is in a table format and when I try to convert this to a struct I get the message 'Scalar structure required for this assignment'
Can someone please help?
for iExcelSubject = 1:size(ExcelFilePatients,1);
GaitReport = ExcelFilePatients(iExcelSubject).name;
[~,SheetNames] = xlsfinfo(GaitReport);
nSheets=numel(SheetNames);
for iSheetData = 1:nSheets
SheetData = readtable(GaitReport,'sheet',iSheetData);
GaitAnalysisReport.(iExcelSubject).(iSheetData) = table2struct(SheetData);
end
end