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: Jordi Gutiérrez Hermoso
Subject: Re: Help in porting a toolbox
Date: Thu, 24 May 2012 17:17:57 -0400

On 24 May 2012 16:35, Mathieu Dubois <address@hidden> wrote:

> ----- 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).

Can you try a newer Octave version?

   
http://www.octave.org/wiki/index.php?title=Octave_for_GNU_Linux:_Binary_Octave_packages_for_GNU_Linux#Unofficial_binaries

>>> 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.

No, yes, *please* report bugs if you find them. We can't make Octave
better if we don't even know what's wrong with it.

- Jordi G. H.


reply via email to

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