📄 xtimesy.c
字号:
#include "mex.h"
void xtimesy(double x[],double y[], double z[])
{
z[0] = x[0]*y[0];
}
void mexFunction( int nlhs, mxArray *plhs[],
int nrhs, const mxArray *prhs[] )
{
double *x,*y, *z;
/* Check for proper number of arguments. */
if(nrhs!=2) {
mexErrMsgTxt("Two inputs required.");
} else if(nlhs>1) {
mexErrMsgTxt("Too many output arguments");
}
/* Create matrix for the return argument. */
plhs[0] = mxCreateDoubleMatrix(1,1, mxREAL);
x = mxGetPr(prhs[0]);
y = mxGetPr(prhs[1]);
z = mxGetPr(plhs[0]);
/* Call the xtimesy subroutine. */
xtimesy(x,y,z);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -