⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pksign.c

📁 好东西啊 人脸识别用的 希望大家多支持这个
💻 C
字号:
#include "mex.h"

void mexFunction(int nlhs, mxArray *plhs[], int nrhs,
                 const mxArray *prhs[])
{
  double *x, *y;
  int mrows, ncols;
  int  i;
  
  /* Check for proper number of arguments. */
 // if (nrhs != 1) {
 //   mexErrMsgTxt("One input required.");
 // } else if (nlhs > 1) {
 //   mexErrMsgTxt("Too many output arguments");
 // }
  
  /* The input must be a noncomplex scalar double.*/
  mrows = mxGetM(prhs[0]);
  ncols = mxGetN(prhs[0]);
 // if (!mxIsDouble(prhs[0]) || mxIsComplex(prhs[0]) ||
 //     !(mrows == 1 && ncols == 1)) {
 //   mexErrMsgTxt("Input must be a noncomplex scalar double.");
 // }

  /* Create matrix for the return argument. */
  plhs[0] = mxCreateDoubleMatrix(mrows,ncols, mxREAL);
  
  /* Assign pointers to each input and output. */
  x = mxGetPr(prhs[0]);
  y = mxGetPr(plhs[0]);
  /* Call the timestwo subroutine. */

  for(i = 0 ; i < mrows*ncols ; i++ )
  {
	  if(x[i] >=0)
		  y[i] = 1;
	  else
		  y[i] = -1;
  }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -