The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Matlab Automation Server
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

jodowd

Ireland
Posts

Posted - 10/09/2011 :  5:33:45 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I have used the Matlab demo (\Samples\Automation Server\MATLAB\CreatePlotInOrigin.m) which works perfectly. But this demo does not show how to get data back from Origin into Matlab. Does anyone know how to read data out of an Origin worksheet into Matlab using the automation server?

greg

USA
1378 Posts

Posted - 10/10/2011 :  1:58:37 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The example you cite uses PutWorksheet method to send data array to Origin. Use the GetWorksheet method for the reverse.
Go to Top of Page

jodowd

Ireland
Posts

Posted - 10/10/2011 :  2:51:49 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Greg,

thanks. GetWorksheet works perfectly.

(1) Send variable mdata to Origin:
invoke(originObj, 'PutWorksheet', 'Data1', mdata);

(2)Read data back into matlab
val=invoke(originObj, 'GetWorksheet', 'Data1')

Go to Top of Page

defender845

USA
Posts

Posted - 12/01/2012 :  4:54:17 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Is there anyway to only pull specific columns using the GetWorksheet command? I'd hate to pull everything into Matlab if I only have 2 columns that I need to have pulled in there.
Go to Top of Page

easwar

USA
1964 Posts

Posted - 12/02/2012 :  5:36:27 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by defender845

Is there anyway to only pull specific columns using the GetWorksheet command? I'd hate to pull everything into Matlab if I only have 2 columns that I need to have pulled in there.



Hi,

See this wiki page:
http://wiki.originlab.com/~originla/wiki/index.php?title=OriginCOM:Application-GetWorksheet
for details on how to specify start/end rows and/or start/end columns.

Easwar
OriginLab
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000