entry point to c/c++ or Fortran MEX file
http://www.mathworks.com/access/helpdesk/help/techdoc/apiref/mexfunction.html
mexFunction (C and Fortran) -
Entry point to C/C++ or Fortran MEX-file
C Syntax
#include "mex.h"
void mexFunction(int nlhs, mxArray *plhs[], int nrhs,
const mxArray *prhs[]);
Fortran
Syntax
subroutine mexFunction(nlhs, plhs, nrhs, prhs)
integer*4 nlhs, nrhs
mwPointer plhs(*), prhs(*)
Arguments
nlhs
Number
of expected output mxArray
s
plhs
Array
of pointers to the expected output mxArray
s
nrhs
Number
of input mxArray
s
prhs
Array of pointers to the
input mxArray
s.
Do not modify any prhs
values in your MEX-file.
Changing the data in these read-only mxArray
s can
produce undesired side effects.
Description
mexFunction
is not a routine you call.
Rather, mexFunction
is the name of the gateway
function in C (subroutine in Fortran) which every MEX-file requires.
When you invoke a MEX-function, MATLAB software finds and loads
the corresponding MEX-file of the same name. MATLAB then searches
for a symbol named mexFunction
within the MEX-file.
If it finds one, it calls the MEX-function using the address of the mexFunction
symbol. MATLAB displays
an error message if it cannot find a routine named mexFunction
inside
the MEX-file.
When you invoke a MEX-file, MATLAB automatically
seeds nlhs
, plhs
, nrhs
,
and prhs
with the caller's information. In the
syntax of the MATLAB language, functions have the general form:
[a,b,c,...] = fun(d,e,f,...)
where
the ...
denotes more items of the same
format. The a,b,c...
are left-hand side arguments,
and the d,e,f...
are right-hand side arguments.
The arguments nlhs
and nrhs
contain
the number of left-hand side and right-hand side arguments,
respectively. prhs
is
an array of mxArray
pointers whose length is nrhs
. plhs
is
an array whose length is nlhs
, where your function
must set pointers for the returned left-hand side mxArray
s.
Examples
See t
Ïà¹ØÎĵµ£º
ÎÊÌâµÄÌá³ö
¡¡¡¡¶à¹úÓïÑԵĴæÔÚ¡¢²»Í¬ÓïÑÔ²Ù×÷ϵͳµÄ´æÔÚ£¬Ê¹µÃÕë¶Ô¶àÓïÑÔµÄÉè¼ÆÆÄ·ÑÖÜÕ£¬ÔÚ±àÂëÉÏËù¸¶³öµÄ¹¤×÷Á¿Ò²Êǿɹ۵ġ£Ëùν±àÂëµÄÎÊÌ⣬¹é½áÆðÀ´£¬¾ÍÊǶþ½øÖƵıàÂëÒÔºÎÖÖ±àÂë¸ñʽ½øÐнâÎöµÄÎÊÌâ¡£ÌØ±ðÊÇÔÚÓ²ÅÌÎļþºÍÄÚ´æÊý¾ÝµÄÏ໥ת»¯¡¢¼´¶Áд¹ý³ÌÖУ¬Èç¹û²ÉÓÃÁË´íÎóµÄ±àÂë¸ñʽ£¬¾Í»áÔì³ÉÂÒÂë¡£JAVA ÓïÑÔÔÚ×Ö·û´ ......
Cר¼Ò±à³Ì ¾«±àÖ®Ò» µÚÒ»ÕÂ~µÚÈýÕÂ
CµÄ¸´ÔÓÖ®´¦ ÔÚÓÚËüµÄÖ¸Õë ,µ«ÊÇ±ÈÆäÖ¸Õë¸üΪ¸´ÔÓµÄÊÇËüµÄÉùÃ÷ !!!
ÄãÄÜ¿´¶®ËüÃǵÄÒâ˼ Âð?
apple=sizeof(int)*p ; apple=sizeof * p;
j= (char (*)[20])malloc(20);
int const * grape; Óë int * const gr ......
ÒýÑÔ
¾¡¹Ü C ÓïÑÔÎÊÊÀÒѽü 30 Ä꣬µ«ËüµÄ÷ÈÁ¦ÈÔδ¼õÍË¡£C ÓïÑÔ¼ÌÐøÎüÒý×ÅÖÚ¶àµÄ¿ª·¢Õߣ¬ËûÃÇΪÁ˱àд¡¢ÒÆÖ²»òά»¤Ó¦ÓóÌÐò¶ø±ØÐëѧϰм¼ÄÜ¡£
±¾ÎÄÊÇΪÁËÂú×ã¶ÔCÓïÑÔ³õѧÕß»òÏëÌá¸ß×ÔÉíCÓïÑÔÐÞΪµÄ¿ª·¢ÈËÔ±µÄÐèÒª¶øÐ´µÄ¡£Ï£Íû¶ÔÄúµÄѧϰºÍ¹¤×÷ÓÐËù°ïÖú¡£ÄúÒ²Ðí²»ÔÞͬÆäÖеÄijЩ·½·¨£¬µ«ÎÒÃÇÏ£ÍûÄú»áϲ»¶ÆäÖеÄһЩ¡£
±¾Î ......
±¾ÎÄÀ´×Ô:Linux½Ì³Ì -- http://doc.linuxpk.com/53295.html
ÈçÓв»Ã÷°×Ö®´¦£¬»¶Ó²Î¼ÓÉçÇøÌÖÂÛ
1.Linux“Ï߳̔
±ÊÕßÔø¾ÔÚ¡¶»ùÓÚǶÈëʽ²Ù×÷ϵͳVxWorksµÄ¶àÈÎÎñ²¢·¢³ÌÐòÉè¼Æ¡·£¨¡¶Èí¼þ±¨¡·2006ÄêµÚ5~12ÆÚ£©ÖÐÏêϸÐðÊöÁ˽ø³ÌºÍÏ̵߳ÄÇø±ð£¬²¢Ôø¾ËµÃ÷LinuxÊÇÒ»ÖÖ“¶à½ø³Ìµ¥Ï߳̔µÄ²Ù×÷ϵͳ¡£ ......
ÔÌû£º
http://hi.baidu.com/pepsi360/blog/item/cc74be4412cf6789b3b7dcd4.html
#include <stdio.h>
struct Node
{
int a;
char b[10];
Node *next;
};
main(void)
{
char *p=NUL ......