Save nested fields from a structure to a .mat file in MATLAB
===

I have a nested structure in MATLAB, for example

out.mid.in1 = 'ABC';
out.mid.in2 = 'DEF';

I can save mid to a .mat file like this:

save('myfile.mat', '-struct', 'out', 'mid')

How can I save just in1 and/or in2?

I could do this:

temp = out.mid;
save('myfile.mat', '-struct', 'temp', 'in1')

or even temp = out.mid.in2, but I hope there is a better way.
