[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Aw: Re: Octave type argument error calling mxGetField

From: Julien Bect
Subject: Re: Aw: Re: Octave type argument error calling mxGetField
Date: Fri, 09 Jan 2015 13:29:01 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.3.0

Le 07/01/2015 19:59, Hans Peschke a écrit :
I just played around a little with your compile.m script and experienced some *very* strange behaviour, which I can not explain.


What is this handle thing. Are these Matlab handle classes then? I read somewhere, that handle classes are not supported by octave. I mean number_ just wraps it in a Wrap object, but what is this handle field about and what happens in line 27?? Do you have an explanation for this?


I haven't tried to understand what your code is really supposed to do, but here are a few remarks.

First, delete.c (line 16) uses mxSetField to modify prhs[0], thus overriding the const specifier.

I don't think that prhs[0] is supposed to be modified (that why it's const).

If you want to modify it, it would probably be safer to use mxDuplicateArray first, modify it, and then return the result as plhs[0].

Second, WrapNew is not defined in number_.c.

If you include Wrap.h, you will see that WrapNew expects a double and you pass a double*.

I suggest changing WrapNew(value) to WrapNew(*value).

Third, "handle" has nothing to do with Matlab's "handle classes".

It is the name of a field in your structure (see Number.m).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]