#include "mex.h"   
   
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])   
{   
    double a, b, c;     
   
    if (nrhs != 2)   
        mexErrMsgTxt("Two inputs required.");   
    else if (nlhs > 1)   
        mexErrMsgTxt("Too many output arguments.");   
   
    if (!mxIsDouble(prhs[0]) || !mxIsDouble(prhs[1]))   
        mexErrMsgTxt("Input arguments must be a scalar.");   
       
    a = mxGetScalar(prhs[0]);   
    b = mxGetScalar(prhs[1]);   
    
	c = a + b;
     
    plhs[0] = mxCreateDoubleScalar(c);   
}  