MATLAB: How to combine mat file

concatenate several math fileMATLAB

I have two mat files named databaseA.mat and datalabelB.mat which have different sizes, databaseA.mat is 8100 x 80 double and datalabelB.mat is 1 x 80 double. I need to combine them into one mat file but don't change their size. Actually I have combined them with the following code
ALoad = load( 'databaseA.mat' );
BLoad = load( 'datalabelB.mat' );
save( 'databaseAB.mat', 'ALoad' );
save( 'databaseAB.mat', 'BLoad', '-append' );
but result "struct" type data, whereas I don't desire it. Could you correct it? Thank you for your help.

Best Answer

ALoad = load( 'databaseA.mat' );
BLoad = load( 'datalabelB.mat' );
a = ALoad.a;
b = BLoad.b;
save( 'databaseAB.mat', 'a', 'b' );
Using load with a return value will give you a struct with your data in it, but you can just get the data out of the struct. You can also do this in other ways, probably neater, but this should work and if it is a one-off operation efficiency or neatness doesn't really matter.