x = linspace(0,10,100);
y = 3*exp(-x/3)*sin(pi*x);
plot(x, y)
xlabel('Time in Seconds')
ylabel('Voltage over time')

回答 (1 件)

Voss
Voss 2021 年 12 月 4 日

0 投票

You have to use .* (element-wise multiplication) rather than * (matrix multiplication):
y = 3*exp(-x/3).*sin(pi*x);

1 件のコメント

Ethan Gomez
Ethan Gomez 2021 年 12 月 4 日
Ahh okay thank you very much

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

カテゴリ

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

質問済み:

2021 年 12 月 4 日

コメント済み:

2021 年 12 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by