MATLAB Answers

Get coeffs of exponents

1 view (last 30 days)
How can I get the coeffs of exponents?
for example:
A=-1*exp(t*w*-1i)/2 + exp(t*w*1i)/2 - exp(t*w*2i)/2 + exp(t*w*-2i)/2
I want to get: [-0.5, 0.5, -0.5, 0.5]

Accepted Answer

Sai Veeramachaneni
Sai Veeramachaneni on 5 Mar 2021
Hi,
You can use syms and coeffs.
Example:
syms t w i
A=-1*exp(t*w*-1i)/2 + exp(t*w*1i)/2 - exp(t*w*2i)/2 + exp(t*w*-2i)/2
coeffs(A)
Hope it helps.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!