octave-maintainers
[Top][All Lists]
Advanced

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

Correct behavior of common_size()?


From: Robert T. Short
Subject: Correct behavior of common_size()?
Date: Wed, 14 Mar 2012 09:59:22 -0700
User-agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2

When I include an empty vector in common_size() I get, for example,

octave> [ec,x,y,z]=common_size([],1,[1 2 3])
ec =  1
x = [](0x0)
y =  1
z =

   1   2   3

In other words, I get an error because the empty matrix can't be sized to match the other elements. I wonder if this is the correct behavior, though. It is not clear to me what *should* happen and there is probably a good reason for the current approach, but in addition to the current behavior one of two possibilities comes to mind:

ec = 0
x = [](0x3)
y = [1 1 1]
z = [1 2 3]

or

ec = 0
x [] (0x0)
y = [1 1 1]
z = [1 2 3]

Thoughts? Or maybe this is just a case of educating Bob? BTW, if a change needs to be made I am volunteering but I need to be clear on the concept first.

Bob


reply via email to

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