cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

1-Newbie

## Simple (I think) query. Convert a function to a Vector...

Hi,

I'm sure this is real easy but I can't see the wood for the trees. Given a function which uses a range variable as it's parameter. How do I convert this to a Vector for use in the fft function?

Thankyou,

Mike.

1 ACCEPTED SOLUTION

Accepted Solutions
5-Regular Member
(To:mshaw-3)

Have a look at the attached.

I have used a pre-defined function to turn your range variable into a vector and also reduced fs to 512.

4 REPLIES 4
5-Regular Member
(To:mshaw-3)

Have a look at the attached.

I have used a pre-defined function to turn your range variable into a vector and also reduced fs to 512.

Brilliant thankyou.

I'm trying to implement a MATLAB FFT solution in MATHCAD. One quick question for anyone reading - using an fs value of 1000 I can run the FFT function within MATLAB but for MATHCAD I need to use either 512, 1024, etc. Why is this?

Thankyou.

23-Emerald II
(To:mshaw-3)
 Mike Shaw wrote:Brilliant thankyou.I'm trying to implement a MATLAB FFT solution in MATHCAD. One quick question for anyone reading - using an fs value of 1000 I can run the FFT function within MATLAB but for MATHCAD I need to use either 512, 1024, etc. Why is this?Thankyou.

Because the Mathcad functions fft (, ifft, FFT and IFFT) assume vectors of length 2^m.

Use the functions cfft (,icfft, CFFT or ICFFT) instead - they allow arrays of arbitrary size.

Stuart

1-Newbie
(To:StuartBruff)

Great thankyou 🙂

Announcements