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: John B. Thoo
Subject: Re: Using eye as in [A eye (2)]
Date: Sat, 4 Feb 2012 16:05:37 -0800

On Feb 4, 2012, at 3:57 PM, Ben Abbott wrote:

> 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.

Ah!  Thank you Ben.  That was dumb on my part.  Maybe I should stop putting a 
space between a function name and the opening parenthesis.

---John.

-----------------------------------------------------------------------
Pascal's wager
<http://archive.catholic.com/thisrock/2003/0303fea1.asp>




reply via email to

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