From help-octave-request at bevo dot che dot wisc dot edu Thu Dec 18 15:55:13 2003 Subject: Re: "end" for row vectors From: taltman at lbl dot gov To: Gerald Ebberink cc: Ricardo Cervera , Date: Thu, 18 Dec 2003 21:55:03 +0000 (UTC) Hi, I get the following in Octave 2.1.50: octave> v = [ 1 2 3 4 5 6 7 8 9 10] v = 1 2 3 4 5 6 7 8 9 10 octave> v(size(v)) ans = 1 10 octave> I think the following two methods would get the desired result: octave> v v = 1 2 3 4 5 6 7 8 9 10 octave> v(columns(v)) ans = 10 octave> v(length(v)) ans = 10 octave> Wait, I just tried v(end), and it worked as expected. What version/platform combo are you using, again? Try upgrading to 2.1.50; 2.1.35 is quite old. HTH, ~Tomer On Dec 18, 2003 at 9:57pm, Gerald Ebberink wrote: ebberi >Date: Thu, 18 Dec 2003 21:57:24 +0100 ebberi >From: Gerald Ebberink ebberi >To: Ricardo Cervera ebberi >Cc: help-octave at bevo dot che dot wisc dot edu ebberi >Subject: Re: "end" for row vectors ebberi >Resent-Date: Thu, 18 Dec 2003 14:57:26 -0600 ebberi >Resent-From: help-octave at bevo dot che dot wisc dot edu ebberi > ebberi >-----BEGIN PGP SIGNED MESSAGE----- ebberi >Hash: SHA1 ebberi > ebberi >Try something like ebberi > ebberi >v(size(v)) ebberi >(should also work in matlab) ebberi > ebberi >Ricardo Cervera wrote: ebberi >| Hello. ebberi >| ebberi >| I have some .m files I ran using matlab. The problem is that ebberi >| they use ebberi >| ebberi >| ebberi >|>v(end) ebberi >| ebberi >| ebberi >| in order to get the last element of a row-vector, and that doesn't ebberi >| seem to work on octave (version 2.1.35, debian package). Is there ebberi >| a similar syntax in octave to do so? ebberi >| ebberi >| Thanks. ebberi >| ebberi >| ebberi >| ebberi >| ebberi >| ------------------------------------------------------------- ebberi >| Octave is freely available under the terms of the GNU GPL. ebberi >| ebberi >| Octave's home on the web: http://www.octave.org ebberi >| How to fund new projects: http://www.octave.org/funding.html ebberi >| Subscription information: http://www.octave.org/archive.html ebberi >| ------------------------------------------------------------- ebberi >| ebberi > ebberi >-----BEGIN PGP SIGNATURE----- ebberi >Version: GnuPG v1.2.3 (GNU/Linux) ebberi >Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org ebberi > ebberi >iD8DBQE/4hSwbSbfYz8yWIMRAqhUAJ9eaoKD+TMwTKrv0EnVupnfi816rgCg6z5k ebberi >aU17Vdy8FF5mTIhRl1ld30k= ebberi >=3E7C ebberi >-----END PGP SIGNATURE----- ebberi > ebberi > ebberi > ebberi >------------------------------------------------------------- ebberi >Octave is freely available under the terms of the GNU GPL. ebberi > ebberi >Octave's home on the web: http://www.octave.org ebberi >How to fund new projects: http://www.octave.org/funding.html ebberi >Subscription information: http://www.octave.org/archive.html ebberi >------------------------------------------------------------- ebberi > ebberi > ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------