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 for Programming
 Forum for Origin C
 A problem in trasferring data to Matlab
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

alligator

Posts

Posted - 07/30/2005 :  12:23:55 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (7.5 SR5):
Operating System: WinXP
Matlab:7.0.0.19920(R14)

I use the Origin C to trasfer data to Matlab. The funtion PutMatrix always return zero, but GetMatrix is ok. It seems the same problem to http://www.originlab.com/forum/topic.asp?TOPIC_ID=3674, but that is not in Origin C. I update the Matlab console as it mentioned. Part of the code is followed. I debug it step by step, and I am sure other steps is right.

Matrix FitData(ML);
FitData.CopyFromWks(Wks);

Matlab MatObj;
MatObj.Attach();

MatObj.Execute("dat=rand(201,3)");

BOOL bRet = MatObj.PutMatrix("mat", &FitData);
if (bRet)
string strRet = MatObj.Execute("mat");
bRet=MatObj.GetMatrix("dat",&FitData);


Regards
Alligator

shulin

USA
1 Posts

Posted - 08/01/2005 :  2:47:25 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi alligator:

If you use Matlab7, you need to add the following code at the beginning of MatlabConsole.c.

#define _USE_COMPLEX_TO_FIX_PR_FOR_MATLAB_7

Thanks, Shulin
OriginLab Corp.
Go to Top of Page

alligator

Posts

Posted - 08/02/2005 :  09:20:05 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you,Shulin
It does not work and
It seems that "#define _USE_COMPLEX_TO_FIX_PR_FOR_MATLAB_7" is not complete? Here, I just transfer real number, not complex number. The console "pr" works well but Origin C seems not.
Is that the reason in Help File for command "PutMatrix""Transfer Origin Matrix to Matlab matrix. OriginC matrix not currently supported. Complex matrices not currently supported"?
If, in my codes, it is OriginC Matrix, why the example use this one?


Edited by - alligator on 08/02/2005 11:38:41 AM
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