help-octave
[Top][All Lists]
Advanced

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

Re: Using eye as in [A eye (2)]


From: Ben Abbott
Subject: Re: Using eye as in [A eye (2)]
Date: Sat, 04 Feb 2012 18:57:58 -0500

On Feb 4, 2012, at 6:51 PM, John B. Thoo wrote:

> Hi.  I have a newbie question.
> 
> If I define
> 
> A = [1,3;1,2]
> 
> and
> 
> D = eye (2)
> 
> then I get as expected
> 
> octave-3.2.3:20> [A D]
> ans =
> 
>   1   3   1   0
>   1   2   0   1
> 
> 
> But [A eye (2)] does not give the same thing:
> 
> octave-3.2.3:21> [A eye (2)]
> error: number of rows must match (1 != 2) near line 21, column 5
> octave-3.2.3:21>
> 
> What am I not understanding?  TIA.
> 
> ---John.

The syntax [A eye (2)] is equivalent to [A, eye, 2].

Try [A, eye(2)] instead.

Ben




reply via email to

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