Hello,
I am comparing two separate files of data and have loaded the .mat files into structs. One file has field names that are in all capital letters. Ideally I just want to ignore the case altogether. Hpwever, I am unsure how to do this and so I have tried using:
x = upper(load('filename.mat'))
x= load('filename.mat')
y=upper(x)
To change all the fields to uppercase. Niether of these work. ( I also changed the search variables to match case for this)
My code looks like this:
myVars = {'Abc_B', 'Aaa_A', 'B_Ahh', 'Ba_Bcc', 'Dea_C_CC' };
b_struct = load('filename1.mat');
f_struct = load('filename2.mat');
for iVar=1:numel(myVars)
f_sp = f_struct.(myVars{iVar});
b_sp = b_struct.dArray.(myVars{iVar});
...
end
And the issue happens when b_struct tries to read in 'B_Ahh', because b_struct the field is 'B_AHH'
The error that matlab gives is this:
Reference to non-existent field 'B_Ahh'.
Error in final_dataPrep
b_sp = b_struct.dArray.(myVars{iVar});
But it outputs previous fields whose case match my search words.
Ideally, I just want to ignore the case altogether.
I am lost and frustrated about this. Any guidance would be greatly appreciated!