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

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

[Octave-bug-tracker] [bug #62468] quadgk.m should be able to do array-va


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #62468] quadgk.m should be able to do array-valued integration
Date: Thu, 19 May 2022 16:45:34 -0400 (EDT)

Follow-up Comment #21, bug #62468 (project octave):

Okay, I looking back I think my size comment doesn't apply to 'arrayvalued'.
My understanding of Matlab's integrator requiremnet for other functions is
that for any f such that a = f(x), no matter what goes on inside f,
size(a)=size(x).  that way it can iterate on f with vectorized expansion of x
of any size, and not have 'a' grow or shrink in size.  

I guess this requirement is disabled for 'arrayvalued', where they probably
chose a less efficient codepath to allow arbitrary resizing.  e.g.,


integral(@(x) x*x, 0, 1,'arrayvalued',1)

ans =

   333.3333e-003

>> integral(@(x) x*x, 0, 1)
Error using  * 
Incorrect dimensions for matrix multiplication. Check that the
number of columns in the first matrix matches the number of rows
in the second matrix. To operate on each element of the matrix
individually, use TIMES (.*) for elementwise multiplication.

Error in @(x)x*x



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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