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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 A problem in trasferring data to Matlab

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
alligator Posted - 07/30/2005 : 12:23:55 PM
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
2   L A T E S T    R E P L I E S    (Newest First)
alligator Posted - 08/02/2005 : 09:20:05 AM
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
shulin Posted - 08/01/2005 : 2:47:25 PM
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.

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000