Get coeffs of exponents

1 view (last 30 days)
Ohad Shapira
Ohad Shapira on 1 Mar 2021
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)

Categories

Find more on Mathematics in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!