I've tried to dynamically call the different fields but I'm not sure how to handle the changing header strings (i.e. c0_Curve_ChangingHeaderStrings).
%%Get info on .mat file and sample names
% Get .mat file name, open and load it
[file, path] = uigetfile('.mat', 'Open PSTrace .mat file');matObj = matfile([path file]); %'Ugo_February_26th_Data.mat'
load([path file]);% Get details of .mat file
details = whos(matObj);% Get number of scanned curves and scans/sample
N = numel(fieldnames(matObj))-1;Number_of_Samples = input('Number of voltammetry curves per sample = ');% Get .xls file name, open and load it
[file, path] = uigetfile('.xlsx', 'Open Excel file with sample names');[num, Sample_Label, raw] = xlsread([path file]); %'Ugo_February_26th_Data.mat'%%Organizes curves in corret order because of .mat field naming convention
%%Signal Evaluation
Count = 0; for i = 1:N/Number_of_Samples for j = 1:Number_of_Samples %Sample(i,j).s = eval(['c' num2str(Count) '_Curve']); %This works if I have no headers
Sample(i,j).s = eval(details(i).name); Count = Count +1; endend
Any suggestions would be greatly appreciated!
Best Answer