Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

c µ÷Óà matlab engine ×Ô¶¨Ò庯Êý

ÉèÖãº
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;


Ïà¹ØÎĵµ£º

ʹÓÃPTDD ½â¾ö¶à¸ö·ÖÇøGHOSTºó±äÒ»¸öCÅÌ·ÖÇø½â¾ö°ì·¨


¡¡¡¡Óû§Ê¹ÓÃGhostÖØװϵͳ£¬¾­³£³öÏÖ C D E F ...¶à¸ö·ÖÇø ±ä³ÉÒ»¸ö C·ÖÇø£¬Ôì³ÉÊý¾Ý¶ªÊ§£¬Õâʱ¾ÍÐèÒªÊý¾Ý»Ö¸´¹¤×÷¡£
¡¡¡¡ËäÈ»Õû¸öÓ²Å̱ä³ÉÁËÒ»¸ö·ÖÇø£¬µ«Í¨¹ýÊý¾Ý»Ö¸´¼¼Êõ¿ÉÒÔÊdzýÔ­À´µÄC·ÖÇøÍ⣬ÆäËü´ÅÅÌ·ÖÇøµÄÊý¾Ý¶¼Äܱ»»Ö¸´¡£
     ÏÂÃæÎÒÃÇÀ´¿´ÈçºÎÀ´»Ö¸´£º
     ÕâÀïÎ ......

c/c++¾­µäÃæÊÔÊÔÌâ¼°±ê×¼´ð°¸

¾­¹ý¼¸´ÎÃæÊÔ£¬·¢ÏÖ±ÊÊÔÌâ»ù±¾É϶¼ÊÇÄǼ¸µÀ£¬Ã»ÓÐʲô´´Ð»òÕ߸ı䣬×ܽá³öÀ´¸ø´ó¼Ò²Î¿¼²Î¿¼.
  
Ò»¡¢ÇëÌîдBOOL , float, Ö¸Õë±äÁ¿Óë“ÁãÖµ”±È½ÏµÄ if Óï¾ä¡££¨10·Ö£©
Çëд³ö BOOL flag Óë“ÁãÖµ”±È½ÏµÄ if Óï¾ä¡££¨3·Ö£©
±ê×¼´ð°¸£º
    if ( flag )
  & ......

C°æ¡¶ÉúÈÕ¿ìÀÖ¡·

#include<windows.h>

void Birthday();

int main()
{
Birthday();
return 0;
}

void Birthday()
{
unsigned frequency[]={392,392,440,392,523,494,

392,392,440,392,587,523,

......

ÈçºÎÖÕÖ¹Ï̵߳ÄÔËÐУ¨C/C++£©

ÈçºÎÖÕÖ¹Ï̵߳ÄÔËÐУ¨C/C++£©
ÏëÒªÖÕÖ¹Ï̵߳ÄÔËÐУ¬¿ÉÒÔʹÓÃÒÔÏ·½·¨£º
1¡¢Ï̺߳¯Êý·µ»Ø£¨×îºÃʹÓø÷½·¨£©¡£
2¡¢Í¨¹ýµ÷ÓÃExitThreadº¯Êý£¬Ï߳̽«×ÔÐг·Ïû£¨×îºÃ²»Ê¹Óø÷½·¨£©¡£
3¡¢Í¬Ò»¸ö½ø³Ì»òÁíÒ»¸ö½ø³ÌÖеÄÏ̵߳÷ÓÃTerminateThreadº¯Êý£¨Ó¦±ÜÃâʹÓø÷½·¨£©¡£
4¡¢ExitProcessºÍTerminateProcessº¯ÊýÒ²¿ÉÒÔÓÃÀ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ