[Top][All Lists]

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

[Octave-bug-tracker] Problem with matrix access in oct files with versio

From: Sylvain Marchand
Subject: [Octave-bug-tracker] Problem with matrix access in oct files with versions > 3.4.3
Date: Tue, 3 Jul 2012 18:01:32 +0200


I encounter memory access problems with Matrix in oct files with octave 
versions > 3.4.3.

For example, the following code works with octave 3.4.3, but fails with octave 
[built with 'CXXFLAGS=-O2 mkoctfile inspect.cc' on MacOS 10.6.8]

Is this a bug or am I wrong (I have read the docs, the forums, and this code is 
quite simple...)?

Thanks in advance.

 Best regards,

Sylvain Marchand.


#include <octave/oct.h>
#include <octave/parse.h>
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <string.h>

using namespace std;

DEFUN_DLD (inspect, args, , "inspect")
  Matrix signal = Matrix (1,2);

  signal(0) = 123.456;

  cout << "Will be displayed..." << endl;

  cout << signal(0) << endl;

  cout << "Will NOT be displayed on recent Octave versions..." << endl;

  return octave_value(0);

// End Of File

reply via email to

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