[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: |
Wed, 18 Aug 2010 12:43:12 +0100 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Mon, Aug 16, 2010 at 05:00:46PM +0100, Andy Buckle wrote:
> > 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?
>
> >a=ones([3 2]);
> >[c r]=size(a)
> c = 3
> r = 2
> >s=size(a)
> s =
>
> 3 2
>
> To write a function that behaves like size does, you could use nargout.
>
> --
> /* andy buckle */
Thanks guys, it makes sense now!