[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help with mexEvalString
From: |
c. |
Subject: |
Re: Help with mexEvalString |
Date: |
Fri, 9 Sep 2016 09:39:54 +0200 |
On 9 Sep 2016, at 05:41, Rik <address@hidden> wrote:
> 9/8/16
>
> Could someone compile and run the following mex file under Matlab and see
> what it does? I'm interested in whether it ever gets to the second
> mexPrintf line.
>
> -- File: tstmex.c --
> #include "mex.h"
>
> void
> mexFunction (int nlhs, mxArray *plhs[],
> int nrhs, const mxArray *prhs[])
> {
> int status;
> const char * str = "[pi";
>
> mexPrintf ("Before\n");
> status = mexEvalString (str);
> mexPrintf ("After, status = %d\n", status);
> }
> -- End File --
>
> I think these commands will do it
>
> mex tstmex.c
> tstmex ()
>
> --Rik
here you are:
------------------------------
>> mex testmex.c
Building with 'Xcode with Clang'.
MEX completed successfully.
>> testmex
Before
Error: This statement is incomplete.
After, status = 1
>> version
ans =
9.0.0.341360 (R2016a)
>>
------------------------------
c.