The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: sum of exponentials
Replies: 9   Last Post: Nov 24, 2012 7:16 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Roger Stafford

Posts: 5,929
Registered: 12/7/04
Re: sum of exponentials
Posted: Nov 24, 2012 12:28 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"dwi" wrote in message <k8qlsv$ktj$>...
> Ok, I understand now how this works. But still, you said the result will be
> x(3)+x(2)*e^(-1)+x(1)*e^(-2))/(1+e^(-1)+e^(-2));
> while I want
> (x(3)*e^(-1)+x(2)*e^(-2)+x(1)*e^(-3))/(e^(-1)+e^(-2)+e^(-3));
> Also, how would your code change if I had e^(-1/20), e^(-2/20), e^(-3/20) etc?

- - - - - - - -
The two expressions




are identically equal. Just divide the numerator and denominator of the first expression by e^(-1) to get the second expression. What you want and what this code produces are the same thing.

As to your second question, just the two lines

a = x(k) + a*f*e^(-1);
b = 1 + b*f*e^(-1);

would need to be changed to:

a = x(k) + a*f*e^(-1/20);
b = 1 + b*f*e^(-1/20);

Roger Stafford

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.