How to change the class of mxArray double to int in c mex ?
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi,
I am trying to convert a double class mxArray to int. I don't know how to do that. My c code is like below. I would like to create the mxGPUArray "row" in int class, which is the row index of matrix A. In my code, the type of "row" is double.
#include "mex.h"
#include "gpu/mxGPUArray.h"
#define A prhs[0]
void mexFunction(int nlhs, mxArray * plhs[], int nrhs, const mxArray * prhs[])
{
mxArray *tmp[3];
mexCallMATLAB(3,tmp,1,&A,"find");
mxGPUArray const *row = mxGPUCreateFromMxArray(tmp[1]);
}
댓글 수: 3
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 GPU CUDA and MEX Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!