help-octave
[Top][All Lists]
Advanced

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

'end' statement


From: John W. Eaton
Subject: 'end' statement
Date: Thu, 22 Oct 1998 10:00:08 -0500 (CDT)

On 22-Oct-1998, Ferdinand Schinagl <address@hidden> wrote:

| it's me again :-. This is just wishful thinking!
| I want to demonstrate an example of a (matlab) feature
| which I think is very useful:
| 
| >> a=[1,2,3]
| 
| a =
| 
|      1     2     3
| 
| >> a(2:end)
| 
| ans =
| 
|      2     3  
| 
| In octave I'd do:
| 
| octave:21> a(2:length(a))
| ans =
| 
|   2  3
| 
| which is rather inconvenient, and it makes octave
| less matlab compatible.
| 
| Any concerns?

Can `end' occur in other contexts, or just in colon expressions that
are used as indices?  I assume the following are also ok.  Can someone
please check?

  x(end:-1:1)
  x(end)

Thanks,

jwe


  



reply via email to

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