c++ - Output GNU Octave (or Matlab) matrix into a file with C array syntax -
i have big matrix in octave need it's data imported c++ code. matrix numbers , save c array in header file.
example :
> # octave: results = -3.3408e+01 -5.0227e+00 4.3760e+01 3.2487e+01 1.0167e+01 4.1076e+01 6.3226e+00 -3.7095e+01 1.3318e+01 3.8582e+01 -2.1087e+01 -6.1606e+00 4.8704e+01 3.1324e+01 3.0287e+01 4.0114e+01 1.5457e+01 -3.6283e+01 2.6035e+01 4.0112e+01
needed output:
/* in foo.h */ static const float results = { 3.3408e+01,-5.0227e+00,4.3760e+01,3.2487e+01,1.0167e+01,4.1076e+01,6.3226e+00,-3.7095e+01,1.3318e+01,3.8582e+01, 2.1087e+01,-6.1606e+00,4.8704e+01,3.1324e+01,3.0287e+01,4.0114e+01,1.5457e+01,-3.6283e+01,2.6035e+01,4.0112e+01, };
Comments
Post a Comment