plot and image demos (conversion to character)

Ben Abbott bpabbott at mac.com
Thu May 28 16:36:03 CDT 2009


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


More information about the Octave-maintainers mailing list