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: Exporting MATLAB data in real time to Microsoft Excel 2007/2010
Replies: 2   Last Post: Feb 28, 2013 2:14 AM

Advanced Search

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

Posts: 1,347
Registered: 3/19/07
Re: Exporting MATLAB data in real time to Microsoft Excel 2007/2010
Posted: Feb 28, 2013 2:14 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Paolo" wrote in message <kegvjo$crd$1@newscl01ah.mathworks.com>...
> Hi,
>
> I am trying to export some MATLAB data (which changes in real time through a bluetooth sensor) but I am having trouble with errors.
>
> One method was to use ddeinit and ddepoke:
>
> channel = ddeinit('excel','control.xls');
>
> rc = ddepoke(channel, 'r1c1', mean(openmotion1));
>
>
> However after 30 secs it would give me the following error message:
>
> Error using ddepoke
> The first argument 'channel' is not valid.
>
> Error in btcallback (line 35)
> rc = ddepoke(channel, 'r1c1', mean(openmotion1));
>
> Error in instrcb (line 36)
> feval(val{1}, obj, eventStruct, val{2:end});
>
> So instead, I try to use xlswrite but I am not sure how to export the data in real time using this function. Would I have to use ActiveX? And if so, could someone please enlighten me on how to do so?


xlswrite starts a dedicated Excel process each time it is invoked, so it is hardly performant. Instead, use xlswrite1 or officedoc from the File Exchange, both of which keep Excel open and communicate directly with it, which should be fast enough for your needs.

Related: http://undocumentedmatlab.com/blog/fixing-matlabs-actxserver/

Yair Altman
http://UndocumentedMatlab.com



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.