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

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

[Octave-bug-tracker] [bug #51728] del2 fails on 1-D input with a vector


From: Rik
Subject: [Octave-bug-tracker] [bug #51728] del2 fails on 1-D input with a vector as spacing
Date: Fri, 11 Aug 2017 12:22:47 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0

Update of bug #51728 (project octave):

                  Status:                    None => Confirmed              

    _______________________________________________________

Follow-up Comment #1:

Certainly Octave should be able to calculate this.

I think the issue is that Matlab defaults unspecified dimensions to a spacing
of 1, despite the fact that the documentation says 


 The number of spacing inputs must be equal to the number of dimensions in U.


For reference, see http://www.mathworks.com/help/matlab/ref/del2.html.

In Octave, the simple way to get this to work is to specify all dimensions. 
In the Matlab language everything has a minimum of two dimensions.  1-D
objects, vectors, are really just Nx1 or 1XN matrices.  I can get your code to
work simply by supplying a spacing for the Y dimension.

Sample:


x = linspace(-2*pi,2*pi);
U = cos(x);
L = 4*del2(U,x, 1);


The m-file del2 hasn't been reviewed for a long time and probably needs an
overhaul.  Given that you have access to Matlab, can you run a few sample
pieces of code through Matlab and report the result?


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?51728>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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