help-octave
[Top][All Lists]
Advanced

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

Re: simple matrix problem


From: Geraint Paul Bevan
Subject: Re: simple matrix problem
Date: Wed, 05 Nov 2003 14:47:37 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Joel Jordan wrote:
|
| The problem is, how do I detrend the 2nd column?
|
| I thought maybe the command would be
| detrend(data(1))
|

The colon operator (:) is used to represent a column or row in Octave
(and Matlab), so the command to detrend the data in the second column
would be:

detrended_col = detrend ( data ( : , 2 ) )

You do not have to create a new vector, you can edit the original:

data = [ data ( : , 1 ) , detrend ( data ( : , 2 ) ) ]

or create it on the fly:

plot ( data ( : , 1 ) , detrend ( dat ( : , 2 )) )

- --
Geraint Bevan
http://www.mech.gla.ac.uk/~gbevan

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iEYEARECAAYFAj+pDYcACgkQcXV3N50QmNOIjgCfXrcgIAAzw1xRXForZjsonm/L
VJUAniZUlsbdKAyQuXos5THGlj3/se49
=xLNz
-----END PGP SIGNATURE-----



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



reply via email to

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