Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Export Data from C to MATLAB
Replies: 10   Last Post: Oct 31, 2012 9:22 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Jeff

Posts: 113
Registered: 11/22/09
Re: Export Data from C to MATLAB
Posted: Oct 31, 2012 7:06 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"James Tursa" wrote in message <k6s4rt$j6t$1@newscl01ah.mathworks.com>...
> "Jeff" wrote in message <k6s4b0$hbd$1@newscl01ah.mathworks.com>...
> > As a followup question, what is the best way to export data from a C program on Linux (on a system which does not have MATLAB on it) to be used in MATLAB?
> >
> > Just to add some detail: my advisor thinks I should just printf the data. But there is a lot of data, might this be too much for MATLAB to accept in a text file? Is there a better way?
> >
> > Thanks.

>
> Best way typically is to simply write the data out to a binary file and then use fopen/fread on the MATLAB side to read it in. Takes less time, less storage, and avoids roundoff differences when compared to a text file approach via printf.
>
> James Tursa


Thanks, James. Since you're speaking to a C and MATLAB newbie, could you provide a line or two of code to clarify "write data out to a binary file"?



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.