help-octave
[Top][All Lists]
Advanced

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

Re: Help in porting a toolbox


From: Mathieu Dubois
Subject: Re: Help in porting a toolbox
Date: Thu, 24 May 2012 22:35:01 +0200 (CEST)


----- Mail original -----
De: "Jordi Gutiérrez Hermoso" <address@hidden>
À: "Mathieu Dubois" <address@hidden>
Cc: address@hidden
Envoyé: Jeudi 24 Mai 2012 22:10:09
Objet: Re: Help in porting a toolbox

On 24 May 2012 15:43, Mathieu Dubois <address@hidden> wrote:

> I wanted to port the SOM toolbox (see:
> http://www.cis.hut.fi/somtoolbox/) to Octave.
[snip]
>> I have some problems with code involving (s)scanf. I have read that there 
>> are a lot of differences between Octave and Matlab in this area.
>> The problematic line can be found in som_read_data.m, line 225:
>>  [s, c, e, n] = sscanf(li, '%s%[^ \t]');
>> The goal of the line is to read the header of a file which contains the data 
>> label.
>> The variable li (the line) contains "SepalL SepalW PetalL PetalW".
>> Under Matlab, s contains "SepalL" (the first label) and the variable n 
>> (which causes the error) contains 8.
>> Under Octave, s contains the correct value but n is 0.

> What Octave version? I just tried this example but got n = 6, not 0.

I use Octave 3.2.4 (under Ubuntu 11.10).

>> Is there a way to know you're under octave (something like a
>> ISOCTAVE variable)? That would be a simple way to write conditionnal
>> code like

>> if exists('ISOCTAVE')
>>  % Octave specific code
>> else
>>  % Matlab specific code
>> end

> If you need to do this, then you have almost surely found an Octave
> bug. Please report it:

>   http://www.gnu.org/software/octave/bugs.html
I don't do that! I was wondering if it would be a way to work aroud the bug.

Mathieu


reply via email to

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