help-octave
[Top][All Lists]
Advanced

[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: Mon, 05 Jan 2015 13:31:41 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.3.0

Le 14/12/2014 20:47, Hans Peschke a écrit :
I wrote a minimal example which reproduces the error. You can grab it from the following git repo
 

or download a zip file from this site:
https://bitbucket.org/mrsep/minig/downloads

It ships with a small compile script which you need to adapt to your environment (path to octave header files etc.)
and also with a short octave script (test.m) which reproduces the error

Please don't get confused with its uselessness, I just kept the structure of the original code and changed all names and removed all the other structs, methods and fields.

Hello Hans,

Please answer *below* when you post on Octave's mailing list (i.e., use bottom-posting).

I have tried your test files (on Octave 3.9.0+ on Ubuntu 14.10 32 bits):

1) If I compile with your compile.sh script, Octave crashes as you describe.

octave:1> test
n = <class Number>
error: octave_class::as_mxArray (): wrong type argument 'class'
panic: impossible state reached in file 'corefcn/mex.cc' at line 556
panic: Abandon -- stopping myself...

2) if I use instead the following instructions directly from octave:

cd lib
mex -c -I. Number.c
mex -c -I. Wrap.c

cd ../matlab
mex -I. -I../lib -D_MEASURE_ number_.c ../lib/Number.o ../lib/Wrap.o

cd ../@Number
mex -I. -I../lib -D_MEASURE_ subsref.c ../lib/Number.o ../lib/Wrap.o
mex -I. -I../lib -D_MEASURE_ subsasgn.c ../lib/Number.o ../lib/Wrap.o
mex -I. -I../lib -D_MEASURE_ delete.c ../lib/Number.o ../lib/Wrap.o
cd ..

then it doesn't crash. But I still get the following error message:

n = <class Number>
error: invalid index for class
error: called from:
error:   /home/bect/Sandbox/matlabOctave/essaiHansPeschke/minig/test.m at line 7, column 1


3) I have also tried with Matlab R2012a. I get this

>> test

n =

    Number object: 1-by-1

ans =

  1.2672e-314

Is it the expected ouput ?

reply via email to

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