how to write this in matlab. c=x+y; where x=p^2*e^j*p and y=q*e^(-j*q); p,q ranges from 1:1:k.

 採用された回答

Andrei Bobrov
Andrei Bobrov 2017 年 9 月 10 日

0 投票

t = 1:k;
c = t.^2.*exp(1i*t) + t.*exp(-1i*t);

1 件のコメント

Andrei Bobrov
Andrei Bobrov 2017 年 9 月 10 日
t = 1:k;
p=(2*t.^2+t+1)';
q=(2*t.^2+3*t+2)';
c = p.^2.*exp(1i*p) + q.*exp(-1i*q);

サインインしてコメントする。

その他の回答 (1 件)

KSSV
KSSV 2017 年 9 月 10 日

0 投票

p=1:1:k;
q=p;
x=p.^2*exp(j*p);
y=q.*exp(-j*q);
c=x+y;

1 件のコメント

phoenix
phoenix 2017 年 9 月 10 日
dont i need any loop here?

サインインしてコメントする。

カテゴリ

ヘルプ センター および File Exchange で Get Started with MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by