how to script rectangular function in MATLAB
11 ビュー (過去 30 日間)
古いコメントを表示
Which function should I use for a rectangular function in MATLAB?
0 件のコメント
回答 (1 件)
John D'Errico
2023 年 4 月 26 日
Define what a rect function is, since I find it difficult to read your mind. I'll guess it might be a unit rectangular pulse of some sort. Perhaps this:
In that case, a rect function is simple enough to create, as the difference of two heaviside functions.
help heaviside
For example:
rect = @(x) heaviside(x + 0.5) - heaviside(x - 0.5);
fplot(rect,[-2,2])
I've defined it there to be consistent with what mathworld shows.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
