image
Physics Forums Logo
image
image
* Register * Upgrade Blogs Library Staff Rules Mark Forums Read
image
image   image
image

Go Back   Physics Forums > Mathematics > General Math


Reply

image Calculating FT using matlab quad function Share It Thread Tools Search this Thread image
Old Nov25-09, 01:32 PM                  #1
lefti2003

lefti2003 is Offline:
Posts: 1
Calculating FT using matlab quad function

Hi All,
I am new to this forum and new to using the quad function. Some assistance would be most helpful. I appreciate all help in advance.

I have a .m file called OneExpDecay.m that has the following

syms t
x=exp(-2*t^2);
[RX,IX]=ft(x,-inf,inf);

then I have an ft.m that has the following

function [RX,IX]=ft(x,a,b)
syms t f
fr=@(t)x*cos(2*pi*f.*t);
RX=quad(fr,a,b);
fim=@(t)x*sin(2*pi*f.*t);
IX=-quad(fim,a,b);

When I run OneExpDecay.m I get the following errors that I do not understand how to resolve

?? Undefined function or method 'isfinite' for input arguments of type 'sym'.

Error in ==> quad at 81
if ~isfinite(y(1))

Error in ==> ft at 4
RX=quad(fr,a,b);

Error in ==> OneExpDecay at 3
[RX,IX]=ft(x,-inf,inf);





Thanks
Lefti
  Reply With Quote
Old Nov25-09, 03:16 PM                  #2
KLoux

KLoux is Offline:
Posts: 171
Re: Calculating FT using matlab quad function

The error that your receiving about functions being undefined for inputs of type sym means that you're trying to send a symbol into a function that is expecting a number (or numbers).

Here, my guess is that you need to use finite limits (inf and -inf won't cut it). Try replacing them with numbers.

Hope this helps.

-Kerry
  Reply With Quote
image image
Reply
Thread Tools


Similar Threads for: Calculating FT using matlab quad function
Thread Thread Starter Forum Replies Last Post
erf function in MATLAB Barkan Math & Science Software 2 Sep23-09 11:10 PM
MATLAB quad function StAndrews Math & Science Software 1 Mar28-09 04:35 AM
Does a function exist (prefferably in matlab) that finds a function in noise j-lee00 Math & Science Software 4 Jul13-08 09:26 PM
Calculating variance- matlab discrepancy asif zaidi Math & Science Software 0 Jan26-08 01:11 AM
Matlab mex-function cre_96 Math & Science Software 0 Jul10-07 11:42 AM

Powered by vBulletin Copyright ©2000 - 2010, Jelsoft Enterprises Ltd. © 2009 Physics Forums
Sciam | physorgPhysorg.com Science News Partner
image
image   image