フィルターのクリア

step signal at specific time

3 ビュー (過去 30 日間)
Kanbodin
Kanbodin 2022 年 11 月 9 日
編集済み: Askic V 2022 年 11 月 9 日
Hi, I want to create a step signal at a specific corresponding time.
like the below picture, but the step impulse occur at t = [0.2, 0.5, 0.7, 1.3] or whatever number that i choose

回答 (1 件)

Askic V
Askic V 2022 年 11 月 9 日
編集済み: Askic V 2022 年 11 月 9 日
You might want something like this:
value = 0.8;
occ_points = [0.2, 0.5, 0.7, 1.3];
t = 0:0.01:2;
y = value * ones(size(t));
for ii = 1:numel(occ_points)-1
start_p = find(t > occ_points(ii), 1, 'first');
end_p = find(t <= occ_points(ii+1),1,'last');
y(start_p:end_p) = y(start_p:end_p) * (-1)^ii;
end
plot(t,y)

カテゴリ

Help Center および File ExchangeDownloads についてさらに検索

タグ

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by