/*================================================================= * mxcreatecharmatrixfromstr.c * * This example takes MATLAB strings as inputs. It returns a * vertically concatenated matrix of the input strings. If the * example is compiled as follows: * * mex mxcreatecharmatrixfromstr.c -DSPACE_PADDING * * it will create a matrix with space padding. If it is compiled * without the flag, the matrix of strings that is created will have * NULL padding. * * This is a MEX-file for MATLAB. * Copyright 1984-2000 The MathWorks, Inc. * All rights reserved. *=================================================================*/ /* $Revision: 1.6 $ */ #include "mex.h" void mexFunction(int nlhs,mxArray *plhs[],int nrhs,const mxArray *prhs[]) { int i; char *str[100]; /* Check for proper number of input and output arguments */ if (nrhs < 2) { mexErrMsgTxt("At least two input arguments required."); } if(nlhs > 1){ mexErrMsgTxt("Too many output arguments."); } for (i=0; i