ÉèÖãº
1. Tools/Projects and Solutions/VC ++ Directories
Inlcude files: C:\Program Files\MATLAB\R2009a\extern\include
Library files: C:\Program Files\MATLAB\R2009a\extern\lib
2. Property
Configuration Properties/Linker
General: Additional Library Directories: "C:\Program Files\MATLAB\R2009a\extern\lib\win32\microsoft"
Input: Additional Dependencies: libmx.lib libmat.lib libeng.lib
#include
"stdafx.h"
#include
#include
#include
#include
fun_XY.m file
function Z = fun_XY(X,Y)
Z = X*Y;
<stdio.h><stdlib.h><conio.h>"engine.h"
int
main(int argc, char
**argv)
{
double
X[3][2] = {{1,4},{2,5},{3,6}};
double
Y[2][2] = {{1,2},{3,4}};
int
succeedNotFlag = 1;
Engine *ep;
if
(!(ep = engOpen(NULL)))
{
exit(1);
}
engSetVisible(ep,1);
mxArray *xx = mxCreateDoubleMatrix(3,2,mxREAL);
mxArray *yy = mxCreateDoubleMatrix(2,2,mxREAL);
memcpy(mxGetPr(xx),X,6*
sizeof(double
));
memcpy(mxGetPr(yy),Y,4*
sizeof(double
));
engPutVariable(ep,
"X"
,xx);
engPutVariable(ep,
"Y"
,yy);
int
rows = mxGetM(xx);
int
cols = mxGetN(xx);
////succeedNotFlag = engEvalString(ep,"cd D:\\progX\\CM\\mt");
//succeedNotFlag = engEvalString(ep,"path(path,'D:\progX\CM\mt')"); //will not go to the right routine.
succeedNotFlag = engEvalString(ep,
"path(path,'D:\\progX\\CM\\mt')");
////will go to the right routine.
succeedNotFlag = engEvalString(ep,
"Z = fun_XY_lan(X,Y);"
);
mxArray *z_ptr = NULL;
z_ptr = engGetVariable(ep,
"Z"
);
double *z_c = new double
[6];
z_c = (
double
*) mxGetData(z_ptr);
mxDestroyArray(xx);
mxDestroyArray(yy);
delete
[]z_c;
engClose(ep);
return
0;
ÉÏһƪÖÐÎÒÃÇÒѾÁ˽âÈçºÎÔÚPython³ÌÐòºÍCÄ£¿éÖ®¼ä½øÐÐÖµµÄÏ໥´«µÝ£¬ÏÖÔÚÎÒÃÇÀ´½øÈëʵ×÷½×¶Î£¬¿´¿´ÈçºÎ½«Ò»¸öCÓïÑÔ¿ª·¢µÄ¿ªÔ´mp3±à½âÂë¿âLAME°üװΪһ¸öPythonÏ¿ÉÒÔʹÓõÄÀ©Õ¹Ä£¿é¡£Ê×ÏÈÈ¥http://lame.sourceforge.net/download.phpÏÂÔØLAMEµÄÔ´´úÂ룬ȻºóÇл»µ½rootÓû§±àÒëÔ´´úÂ룬./configure
make
make instal ......
½ñÌì¿´K&RµÄÊéµÄʱºò˳±ãÎÂϰÁËCµÄÁíÒ»ÖØÒªÊý¾Ý½á¹¹bit-fields£¬ÎÒÏëbit-fieldsÔÚ±àдµ×²ãÇý¶¯
Çý¶¯³ÌÐòµÄʱºòÓ¦¸Ã±È½ÏºÃÓã¬Ëü¿ÉÒÔÈÆ¿ª"&"ºÍ"|"½øÐÐλ²Ù×÷£¬¶øÇÒ¸ü¼Ó½ÚÔ¼ÄÚ´æ¿Õ¼ä¡£·Ï»°²»¶à˵
ÁË£¬»¹ÊÇÏÈÀ´¿´¿´ËüµÄÕæÃæÄ¿°É£º
bit-fieldÀ´Ô´:
bit-fieldÊÇΪÁ˽ÚÔ¼´æ´¢¿Õ¼ä¶ø´´ÔìµÄÒ»ÖÖÊý¾ ......