How can I represent these graphs as vectors?

1 回表示 (過去 30 日間)
Savvas
Savvas 2018 年 11 月 5 日
回答済み: madhan ravi 2018 年 11 月 5 日
Hello,
I have these 2 graphs and I want to represent them as vectors so I can find the convolution between them. This is the first one:
My code:
t1=0:0.01:3;
h=ones(size(t1));
The first one is okay but I can't find a way to create the second one:
Any help?
Thanks in advance

採用された回答

madhan ravi
madhan ravi 2018 年 11 月 5 日
figure(1)
t1=0:0.01:3;
h=ones(size(t1));
h(t1==3) = 0;
plot(t1,h,'-b')
xlim([0 4])
ylim([0 2])
figure(2)
t=1:0.01:2;
x=ones(size(t));
x(t==1 | t==2) = 0;
plot(t,x,'-b')
xlim([0 3])
ylim([0 2])

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by