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

Re: Newbie Question



Dan Fletcher <djfletcher@ucdavis.edu> writes:
> 
> Coeff=DIGITAL_FILTER(Flow,Fhigh,50,40)
> FilteredTestDataSub=CONVOL(Data[0,*],Coeff)
> 
> When I do this, I get an error that says
> 
> CONVOL: Kernel's dimensions are incompatible with operand's.
> 
> I think this is because the Data[0,*] gives a 1xm array rather than a
> vector of length m. I can't figure out any way to change that 1xm array
> into a vector without a FOR DO loop. Is there some simple way to solve
> this problem?
> 

I don't know much about the digital filtering, but if you want to
convert a matrix to a vector, it's pretty simple.  Like this:

FilteredTestDataSub=CONVOL( (Data[0,*])[*] ,Coeff)

Any vector or matrix with a [*] after it will be converted to a
one-dimensional vector.  The parentheses are needed because Data[0,*]
is an expression.

Craig

-- 
--------------------------------------------------------------------------
Craig B. Markwardt, Ph.D.         EMAIL:    craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
--------------------------------------------------------------------------