octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #61340] [octave forge] (splines) csaps produce


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #61340] [octave forge] (splines) csaps produces nonconformant arguments error for valid input
Date: Fri, 15 Oct 2021 11:58:24 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36

Follow-up Comment #1, bug #61340 (project octave):

trying another example from the function help page, I'm getting a
nonconformant argument error from a different part of the code:


x = {linspace(-2,3,51),linspace(-3,3,61)};
[xx,yy] = ndgrid(x{1},x{2});
y = peaks(xx, yy);
noisy = y + (rand(size(y)) - 0.5);
[sval,p] = csaps(x,noisy,[],x);
error: horizontal dimensions mismatch (2x1 vs 1x1)
error: called from
    csaps at line 78 column 3


note that line 78 is an input 'isnan' check.  the function starts with:


  if(nargin < 5)
    w = [];
    if(nargin < 4)
      xi = [];
      if(nargin < 3)
              p = [];
      endif
    endif
  endif

  if(columns(x) > 1)
    x = x';
    y = y';
    w = w';
  endif

  if any (isnan ([x y w](:)) )
    error('NaN values in inputs; pre-process to remove them')
  endif


and the nonconformant argument occurs on the if any isnan check.  w is set to
[],  x is a 2x1 cell array, and y is a 61x51 double array. 

so [x y w] obviously fails. 

according to the matlab doc,  x is permitted to be:

x — Data sites
vector | cell array
Data sites of data values y to be fit, specified as a vector or as a cell
array for multivariate data. Spline f is created with knots at each data site
x such that f(x(j)) = y(:,j) for all values of j.

For multivariate, gridded data, you can specify x as a cell array that
specifies the data site in each variable dimension...


so it appears this is a separate issue, as reading the Octave csaps help it's
simply not set up to handle cell array inputs.   This doesn't explain the
comment #0 issue though, where the inputs are arrays.



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61340>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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