Prev: directory name too long
Next: Pchip
From: Steven Lord on 16 Oct 2006 09:02 "Tim Jones" <hghattas(a)hotmail.com> wrote in message news:ef43a8e.3(a)webcrossing.raydaftYaTP... > This function is in the financial ToolBox. Which file should i > include in Matlab to be able to use the financial ToolBox? You need to have a license for Financial Toolbox and you need to install it in order to use functions from that toolbox. Contact the person who's responsible for your license and ask them if you're licensed for the Financial Toolbox. To check if it is installed, use the VER function. -- Steve Lord slord(a)mathworks.com
From: Tim Jones on 16 Oct 2006 11:29 I am looking for a function that will enable me to test whether a time series rises or falls after a moving average crossover. Thanks Steven Lord wrote: > > > > "Tim Jones" <hghattas(a)hotmail.com> wrote in message > news:ef43a8e.3(a)webcrossing.raydaftYaTP... >> This function is in the financial ToolBox. Which file should i >> include in Matlab to be able to use the financial ToolBox? > > You need to have a license for Financial Toolbox and you need to > install it > in order to use functions from that toolbox. Contact the person > who's > responsible for your license and ask them if you're licensed for > the > Financial Toolbox. To check if it is installed, use the VER > function. > > -- > Steve Lord > slord(a)mathworks.com > > >
From: Emanuele on 16 Oct 2006 12:35
Tim Jones wrote: > > > I am trying to run the function 'movavg' with no success. > What should i include to be able to run it? which package? > > Thanks Ok you want the script for the movavg. You can try with this " function a = movavg(x,n) if nargin<4, error('Not enough input.'), end if n<=0, error('n must be positive.'), end if (n~=floor(n)), error('n must be an integer.'), end if min(size(x))==1, x=x(:); % forces x to be a column vector end [p,q]=size(x); b = (x(1:p,1)); r = (x(1:p,2)); if n>p, error('n must not be greater than the length of x.') end a=[]; for row=1:(p-n+1), a=[a; mean(r(row:(row+n-1),:))]; end [i,z]=size(a); " This is the scripts for moving average, where x is the matrix of data l is the elements of average (l >= 2), q or r are the column for wich i made the movavg. The result is a, for column a his size i < p (size row of x). To choose the column of the matrix you must change in ( b= (x(1:p,1)) the number of column, as example d = (x(1:p,3)) Regards Emanuele |