help-octave
[Top][All Lists]
Advanced

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

Re: [OctDev] Is this a bug?


From: Philip Nienhuis
Subject: Re: [OctDev] Is this a bug?
Date: Tue, 15 Mar 2011 19:44:19 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.11) Gecko/20100701 SeaMonkey/2.0.6

tesi t wrote:


Please post these general Octave questions to the appropriate forum, i.e., help-octave ML rather than octave-forge ML. Octave-forge has nothing to do with this particular issue, other than hosting a Windows octave-3.2.4 binary.

Read on....

In Octave Forge (i.e. Octave 3.2.4) I type:

 > vector = [1 2 3 4 5]
 > [vector; zeros(1,8-8)]

Then I get this answer:
*error: number of columns must match (0 != 5)*

Now, if I type:
 > zeros(1,8-8)
 > [vector; []]

I got the correct answer:
*ans = 1 2 3 4 5*

Matlab doesn't complains about the first two lines and gives the correct
answer.

...correct?

octave-3.3.91.exe:7> vector = [1 2 3 4 5]
vector =

   1   2   3   4   5

octave-3.3.91.exe:8> [vector; zeros(1,8-8)]
ans =

   1   2   3   4   5

So yes, newer Octave versions do what you apparently want.

But whether this was a bug or not, I can't say for sure.
Either way, the dimensions of the upper and lower row you want to create don't match, no matter if the lower row is essentially void or not.

IMO it isn't very "clean" code but I can imagine that similar code can be generated in scripts.

P.


reply via email to

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