help-octave
[Top][All Lists]
Advanced

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

Re: nonconformant arguments


From: Nicholas Jankowski
Subject: Re: nonconformant arguments
Date: Sat, 4 Apr 2020 18:58:40 -0400

Also if i bypass this error I have another errors, for example in this line:
Xn = sum(o_vector,'all');
The debuger says "all" is undefined.


hmmm... looks like matlab's sum added an "all" option in 2018b that hasn't been implemented in Octave yet.  

see:  https://www.mathworks.com/help/matlab/ref/sum.html
vs
https://octave.org/doc/interpreter/Sums-and-Products.html

it's the equivalent of sum(A(:))  (sum every element and return a single number output)

probably an easy fix, but it's a compiled function so if a patch is made you'll need to compile it or wait for it to be rolled out with a future version of octave.  

for now, you can replace  
>> sum(o_vector,'all')

with
 
>> sum(o_vector(:))

that will work no matter the size or shape of o_vector.

I've created a bug report here: https://savannah.gnu.org/bugs/index.php?58116

reply via email to

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