introducing a new variable

조회 수: 1 (최근 30일)
richard
richard 2013년 11월 13일
댓글: richard 2013년 11월 14일
I am trying to introduce a new variable that is in terms of a variable that is known.
r''=(-b/a)*r
where r is just a row vector going from -15:15, r'' is the new variable, b&a are the unknown,real constants.
Ultimately I am trying to express a gaussian function in terms of the r=(-a/b)*r'', and take fft's of these gaussian functions.
I have tried using:
syms r'' a b
however when I am trying to take fft's, matlab is unable to do this because a, b, and r'' are syms.
I can't think of another way to introduce this new variable, maybe after the fft of the gaussian is taken? Below is the code I am using but an error comes up at the last two lines. Any help will be appreciated
clear
syms r'' a b real
r=-15:15;
r=-(a/b)*r'';
h=gaussmf(r,[(0.5)/(2*sqrt(2*log(2))),0]);
g=gaussmf(r,[(0.1)/(2*sqrt(2*log(2))),0]);
H=fft(h);
G=fft(G);

답변 (2개)

Vivek Selvam
Vivek Selvam 2013년 11월 13일

Walter Roberson
Walter Roberson 2013년 11월 13일
I would doubt that you can use r'' as a symbol name. Try using a name that starts with a letter, and consists entirely of letters, digits, or underscores.
  댓글 수: 1
richard
richard 2013년 11월 14일
I have changed my r'' to rr's and the last two lines are still reading out as an error. I changed my code to look life this:
clear
syms rr a b real
rr=-15:15;
r=-(a/b)*rr;
h=gaussmf(r,[(0.5)/(2*sqrt(2*log(2))),0]);
g=gaussmf(r,[(0.1)/(2*sqrt(2*log(2))),0]);
H=fft(h);
G=fft(g);
I have now defined a vector for rr and I want to put r (in terms of a&b the unknown constants, as well as rr) into my gaussian.
In the end, I am wanting to find the function F=G./H, and take f=ifft(F), where f will be in terms of a&b.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Assumptions에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by