rectpuls
サンプリングされた非周期的な矩形波
説明
例
矩形パルスの生成および移動
サンプルレート 10 kHz、幅 20 ms の矩形パルスを 200 ms 間生成します。
fs = 10e3; t = -0.1:1/fs:0.1; w = 20e-3; x = rectpuls(t,w);
同じパルスを 2 つ生成します。
1 つは 45 ms 過去に移動させます。
tpast = -45e-3; xpast = rectpuls(t-tpast,w);
1 つは 60 ms 未来に移動させ、幅を半分にします。
tfutr = 60e-3; xfutr = rectpuls(t-tfutr,w/2);
元のパルスとこの 2 つを同じ座標軸上にプロットします。
plot(t,x,t,xpast,t,xfutr) ylim([-0.2 1.2])
入力引数
t
— サンプル時間
ベクトル
単位矩形パルスのサンプル時間。ベクトルとして指定します。
データ型: single
| double
w
— 四角形の幅
1
(既定値) | 正の数値
四角形の幅。正の数値として指定します。
出力引数
y
— 矩形パルス
ベクトル
単位振幅の矩形パルス。ベクトルとして返されます。
メモ:
非ゼロ振幅の区間は、右側でオープンになるように定義されます。つまり、rectpuls(0.5)
= 0
では rectpuls(-0.5)
= 1
です。
ヒント
rectpuls
は、パルス列生成関数 pulstran
と共に使用できます。
拡張機能
C/C++ コード生成
MATLAB® Coder™ を使用して C および C++ コードを生成します。
バージョン履歴
R2006a より前に導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)