How to insert the coding of t^2 power in MATLAB command window

29 ビュー (過去 30 日間)
Bing Lala
Bing Lala 2020 年 11 月 19 日
編集済み: Bing Lala 2020 年 11 月 19 日
Convolution of 2 Function
h(t)=t^2 for t > 0

回答 (2 件)

Setsuna Yuuki.
Setsuna Yuuki. 2020 年 11 月 19 日
編集済み: Setsuna Yuuki. 2020 年 11 月 19 日
t^2 %for scalar
%Example:
t = 2;
t^2;
ans =
4
t.^2 %for matrix
%Example:
t = [1:12];
t.^2;
ans =
1 4 9 16 25 36 49 64 81 100 121 144

David Hill
David Hill 2020 年 11 月 19 日
t=0:.01:100;
x=@(t)t;
h=@(t)t.^2;
y=conv(x(t),h(t),'same');
subplot(3,1,1)
plot(t,x(t));
subplot(3,1,2)
plot(t,h(t));
subplot(3,1,3)
plot(t,y);
  1 件のコメント
Walter Roberson
Walter Roberson 2020 年 11 月 19 日
Note that the question is obviously homework

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

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by