octave-maintainers
[Top][All Lists]
Advanced

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

Re: plot and image demos (conversion to character)


From: Ben Abbott
Subject: Re: plot and image demos (conversion to character)
Date: Thu, 28 May 2009 17:36:03 -0400


On May 27, 2009, at 12:48 PM, John W. Eaton wrote:

 * the first surfl demo, the contrast demo, and the first imshow demo
   all showed the warning

     warning: range error for conversion to character value

   but that only happened when running all the demos with rundemos
   plot followed by rundemos image, not when running them
   individually.


The warning appears to be part of the rundemos script. I've created a simple example below.

        f = which("__img_via_file__");
        fid = fopen (f);
        str = fscanf (fid, "%s");
        fclose (fid);

Running this, I get

        warning: range error for conversion to character value

min(double(str))
ans = 0
max(double(str))
ans =  125
find(double(str)==0)
ans =  30
str(1:40)
ans = ##Copyright(C)2006,2007,2009SrenHauberg

hmmmm ... looking in the file ...

# Copyright (C) 2006, 2007, 2009 Søren Hauberg

Since this works

octave:25> a = 'Søren'
a = Søren

Can this be fixed in fscanf?

Ben


reply via email to

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