Message Boards Message Boards

Export a Matlab .mat file with Cloud Export?

I am trying to export a Matlab .mat file to the cloud. In the end I would like this to be part of a Web Form. So far I have not been able to find a way for this to work. The following is what I believe should work, but is not working.

exportRules = {"A" -> {{-0.5, 0.5, 0.5, 
      0.}, {0.3333333333333333, -1.6666666666666667, \
-0.3333333333333333, 0.3333333333333333}, {-0.5, 0.5, 0., 
      0.}, {0., -2., 0., 0.}}, 
   "B" -> {{0.}, {1.3333333333333333}, {0.}, {2.}}, 
   "C" -> {{1., 0., 0., 0.}, {0., 1., 0., 0.}, {0., 0., 1., 0.}, {0., 
      0., 0., 1.}, {0., 0., 0., 0.}, {0., -4., 0., 0.}}, 
   "D" -> {{0.}, {0.}, {0.}, {0.}, {0.}, {4.}}};
CloudExport[exportRules, {"MAT", "LabeledData"}, "test.mat"]

Any ideas on how to get this working would be much appreciated.

POSTED BY: Cameron Devine

By trial and error I happened upon a solution,

exportRules = {"A" -> {{-0.5, 0.5, 0.5, 
      0.}, {0.3333333333333333, -1.6666666666666667, \
-0.3333333333333333, 0.3333333333333333}, {-0.5, 0.5, 0., 
      0.}, {0., -2., 0., 0.}}, 
   "B" -> {{0.}, {1.3333333333333333}, {0.}, {2.}}, 
   "C" -> {{1., 0., 0., 0.}, {0., 1., 0., 0.}, {0., 0., 1., 0.}, {0., 
      0., 0., 1.}, {0., 0., 0., 0.}, {0., -4., 0., 0.}}, 
   "D" -> {{0.}, {0.}, {0.}, {0.}, {0.}, {4.}}};
CloudExport[
 ExportString[exportRules, {"MAT", "LabeledData"}], "Character8", 
 CloudObject["StateSpace.mat"]]

I'm not sure why I have to do this, but it appears to work.

POSTED BY: Cameron Devine
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract