フィルターのクリア

Plot with specific x value

1 回表示 (過去 30 日間)
Tu Nguyen
Tu Nguyen 2022 年 3 月 2 日
コメント済み: Tu Nguyen 2022 年 3 月 2 日
clc;
close all;
clear all;
x1= [1 2 3 4 5];
L = 2;
n = linspace(0,4,10);
m =linspace(0,10,10);
h1 = dirac(n - m*L);
idx = h1 == Inf;
h1(idx) = 1;
h2 = dirac(n-m/L);
idx = h2 == Inf;
h2(idx) = 1;
y1 = conv(x1,h1);
y2 = conv(x1,h2);
subplot(1,2,1);
stem(y1);
subplot(1,2,2);
stem(y2);
Hi all, I just want to stem y1 and y2 on x coordiante from 0 to 10. How can I do that? If I set stem(y1,[0 10]), it returns X and Y must have same dimension. Please help me

採用された回答

Cris LaPierre
Cris LaPierre 2022 年 3 月 2 日
Use xlim?
x1= [1 2 3 4 5];
L = 2;
n = linspace(0,4,10);
m =linspace(0,10,10);
h1 = dirac(n - m*L);
idx = h1 == Inf;
h1(idx) = 1;
h2 = dirac(n-m/L);
idx = h2 == Inf;
h2(idx) = 1;
y1 = conv(x1,h1);
y2 = conv(x1,h2);
subplot(1,2,1);
stem(y1);
xlim([0 10]) % xlim
subplot(1,2,2);
stem(y2);
xlim([0 10]) % xlim
  1 件のコメント
Tu Nguyen
Tu Nguyen 2022 年 3 月 2 日
Thank you so much

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInertias and Loads についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by