help-octave
[Top][All Lists]
Advanced

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

Re: Vector assignment problems


From: Ben Price
Subject: Re: Vector assignment problems
Date: Mon, 16 Aug 2010 15:19:33 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

On Mon, Aug 16, 2010 at 10:40:15AM +0200, Jaroslav Hajek wrote:
> On Sun, Aug 15, 2010 at 11:08 PM, Ben Price <address@hidden> wrote:
> > I see that
> >> [a,b] = size([1,2])
> > works, but
> >> [a,b] = [1,2]
> > gives ``error: invalid number of output arguments for constant expression''
> >
> > What am I missing?
> 
> When multiple targets are given on the lhs, the rhs needs to produce
> at least as many values. [1,2] does, however, produce a single vector
> value. You can either do:

Ah, let me check if I understand:

size([1,2]) will return 1 or 2 arguements, depending on context, but
[1,2] is always 1 vector?

Cheers



reply via email to

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