[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: simple matrix problem
From: |
Nathan Weisz |
Subject: |
Re: simple matrix problem |
Date: |
Wed, 5 Nov 2003 15:58:51 +0100 |
Hi,
The problem is, how do I detrend the 2nd column?
I thought maybe the command would be
detrend(data(1))
help -i detrend returns among other things:
- Function File: detrend (X, P)
If X is a vector, `detrend (X, P)' removes the best fit of a
polynomial of order P from the data X.
If X is a matrix, `detrend (X, P)' does the same for each column
in X.
The second argument is optional. If it is not specified, a value
of 1 is assumed. This corresponds to removing a linear trend.
So in your case it would probably be:
detrend(yourmatrix(:,2)); %i.e. all rows, second column
if you want to assign the result to your matrix (as second column):
yourmatrix(:,2) = detrend(yourmatrix(:,2));
You migth consider looking at:
http://www.mathworks.com/access/helpdesk/help/techdoc/learn_matlab/
learn_matlab.shtml
HTH,
Nathan
-------------------------------------------------------------
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
-------------------------------------------------------------