help-octave
[Top][All Lists]
Advanced

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

Re: Octave 2.1.55: wrong type argument `matrix'


From: Stefan van der Walt
Subject: Re: Octave 2.1.55: wrong type argument `matrix'
Date: Sun, 27 Jun 2004 14:06:40 +0200
User-agent: Mutt/1.5.6+20040523i

Hi Paul

Your function makes use of 'append', which is already a built in
function.  You should rename your append.m, and if you really want to
you can even use "dispatch" to replace the default "append" command
with your function:

octave:1> dispatch('append', 'append2', 'matrix')
octave:2> expand_region_for_diam([1,2;3 4])
ans =

  1  2  1  2
  3  3  4  4

Stefan

On Sun, Jun 27, 2004 at 12:56:50PM +1000, Paul C. Leopardi wrote:
> Hi,
> I'm porting a set of Matlab scripts to Octave 2.1.55, and have encountered 
> the 
> following error message:
> 
> error: octave_base_value::list_value(): wrong type argument `matrix'
> error: evaluating assignment expression near line 22, column 15
> error: evaluating if command near line 19, column 1
> 
> The offending code is in the file expand_region_for_diam.m
> 
>  1  function expanded_region = expand_region_for_diam(region)
> 15  fuzz = 100*eps;
> 16  dim = size(region,1);
> 17  s_top = region(dim,1);
> 18  s_bot = region(dim,2);
> 19  if dim > 1
> 20   region_1 = expand_region_for_diam(region(1:dim-1,:));
> 21   expanded_region = [append(region_1, s_top), append(region_1, s_bot)];
> 22  else
> 23   if s_bot == 0
> 24    s_bot = 2*pi;
> 25   end
> 26   if (mod(s_bot - s_top, 2*pi) < fuzz) || (mod(s_bot - s_top, 2*pi) > pi)
> 27    s_bot = s_top + pi;
> 28   end
> 29   expanded_region = [s_top, s_bot];
> 30  end
> 
> The function append is defined in append.m
> 
> function result = append(A,value)
> result = [A; ones(1,size(A,2))*value];
> 
> 1. What does the error message
> "error: octave_base_value::list_value(): wrong type argument `matrix'"
> mean?
> 
> 2. What am I doing wrong and how do I fix it?
> 
> 3. Have I found a bug in Octave?
> 
> 
> 
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
> 
> Octave's home on the web:  http://www.octave.org
> How to fund new projects:  http://www.octave.org/funding.html
> Subscription information:  http://www.octave.org/archive.html
> -------------------------------------------------------------
> 



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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