Author |
Topic  |
|
alligator
Posts |
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
|
|
shulin
USA
1 Posts |
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. |
 |
|
alligator
Posts |
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 |
 |
|
|
Topic  |
|
|
|