MATLAB: Storing values in cell instead of struct

doubleMATLABstruct

Hello,
So I've been wondering about an alternate way to store a whole bundle of information as double instead of struct. This is what I did with struct and I just want to convert the datatype to double.
%Save Data information in a file
A(1).f3=f3;
A(2).f2=f2;
A(3).fL3=fL3;
A(4).fH3=fH3;
A(5).f1_fH3=f1_fH3;
A(6).f2_fH3=f2_fH3;
A(7).ffL3=ffL3;
A(8).fHL3=fHL3;
A(9).fH2_fHL3=fH2_fHL3;
A(10).ff3=ff3;
A(11).f13=f13;
A(12).fH2_fLH3=fH2_fLH3;
A(13).fHH2=fHH2;
A(14).fH1_fHH2=fH1_fHH2;
A(15).fH2_fHH2=fH2_fHH2;
save(Route, 'A');
I'm doing this since I've to pass Route as an argument to a function which I realized does not accept struct and is giving me the error while performing logic and arithmetic operations. Any suggestions?

Best Answer

Try something like
save( Route, '-regexp', '^f\w*\d$' );
this should save all variables, the name of which start with "f" and ends with a number. Or did I miss your question?
.
"convert the datatype to double" . f2, f3, etc. are they not already double? double(f3) converts to double.
.
"values in cell instead"
A = cell( 15, 1 );
A(1) = {f3};
A(2) = {f2};
A(3) = {fL3};
A(4) = {fH3};
A(5) = {f1_fH3};
A(6) = {f2_fH3};
A(7) = {ffL3};
A(8) = {fHL3};
A(9) = {fH2_fHL3};
A(10) = {ff3};
A(11) = {f13};
A(12) = {fH2_fLH3};
A(13) = {fHH2};
A(14) = {fH1_fHH2};
A(15) = {fH2_fHH2};