conv([1,2],[3,4]) fails

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

conv([1,2],[3,4]) fails

Jeff Mason-2

When I type the following at the interpreter prompt I get the
following error:

  octave:28> conv([1,2],[3,4])
  error: conv: both arguments must be vectors

Lookinging into the CONV script (octave/2.0.4/m/polynomial/conv.m)
I see the following test that is causing my trouble:

  function y = conv (a, b)

    if (is_matrix (a) || is_matrix (b))
      error("conv: both arguments must be vectors");
    endif
   
Ive checked the octave docs for discussion on Matrix and Vector
types but havent found anything that tells me why I cant convolve
the two "things" I tried to convolve. What am I missing here?

Thanks -- Jeff

Jeff Mason               |     Radar Analysis Dept.
Mail Stop 0537           |     Dept. Number 2344
Sandia National Labs     |     [hidden email]
PO Box 5800              |     phone (505) 845-8565
Albuquerque, NM 87106    |     FAX (505) 845-9888

Reply | Threaded
Open this post in threaded view
|

Re: conv([1,2],[3,4]) fails

Dirk Eddelbuettel-2

  Jeff> When I type the following at the interpreter prompt I get the
  Jeff> following error:
  Jeff>
  Jeff> octave:28> conv([1,2],[3,4])
  Jeff> error: conv: both arguments must be vectors
  Jeff>
  Jeff> Lookinging into the CONV script (octave/2.0.4/m/polynomial/conv.m)
                                                ^^^^^
  Jeff> I see the following test that is causing my trouble:
  Jeff>
  Jeff> if (is_matrix (a) || is_matrix (b))
  Jeff>   error("conv: both arguments must be vectors");
  Jeff> endif

This is fixed in octave-2.0.5:

  if (! (is_vector (a) && is_vector (b)))
    error("conv: both arguments must be vectors");
  endif                

where it runs just fine:

edd@miles:~/progs/octave> octave
Octave, version 2.0.5 (i486-debian-linux-gnu).
Copyright (C) 1996 John W. Eaton.
This is free software with ABSOLUTELY NO WARRANTY.
For details, type `warranty'.

octave:1> conv([1,2],[3,4])
ans =

   3  10   8                

Hope this helps, Dirk

--
    Dirk Eddelbuettel     [hidden email]     [hidden email]