error too many input arguments

1 回表示 (過去 30 日間)
Kendall Donahoe
Kendall Donahoe 2021 年 4 月 2 日
回答済み: Sulaymon Eshkabilov 2021 年 4 月 2 日
I keep getting an error on line 7: imag((xx0(kk)),'r.') How do I go about fixing this
xx0=zeros(24000,1);
for kk=1:24000
xx0(kk)=exp(i*kk*pi/16);
end
for kk=1:20
plot(real(xx0(kk)))
imag((xx0(kk)),'r.')
hold on
pause(0.5)
end

回答 (2 件)

DGM
DGM 2021 年 4 月 2 日
編集済み: DGM 2021 年 4 月 2 日
Only looking at that line, did you perhaps mean to do this?
plot(imag(xx0(kk)),'r.')

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021 年 4 月 2 日
Here is the corrected one (more efficient in calculation part):
kk=1:24000;
xx0(kk)=exp(1i*kk*pi/16);
N=20;
for ii=1:N
plot(real(xx0(1:ii)),imag(xx0(1:ii)),'r.')
hold on
pause(0.5)
end
Good luck.

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by