Prints the struct param to the file associated with file descriptor fout. Optionally the string prefix can be used as the name of the data structure. The output can be loaded into octave again by means of the source command.
The following code
data.x = 1; data.A = rand(1, 2); data.str = "abc"; data.s = struct("a",{1,2,3},"b",{4,5,6}); data.args(1).y = {1, 2}; data.args(2).y.f = {@sin, @cos}; struct_print(data);
Produces the following output
data.A = [0.3242035837758999,0.3341542135396723]; data.args(1).y = {1,2}; data.args(2).y.f = {@sin,@cos}; data.s(1).a = 1; data.s(1).b = 4; data.s(2).a = 2; data.s(2).b = 5; data.s(3).a = 3; data.s(3).b = 6; data.str = "abc"; data.x = 1;
Package: mboct-octave-pkg