Unitstep Function (Heaviside Function) Plotting Help
古いコメントを表示
I am working with Matlab and I am trying to create a unitstep function using the heavistep function. My code is shown below.
%f(x) = 0 for x<0 and f(x) = 1 for x>=1
function unit = unitstep(t)
unit = heaviside(t);
After creating this file I used the following commands in the command window.
t = -20:0.001:20;
plot (unitstep(t));
When I plot the unitstep function I created I get the below image. My question is why does the graph rise to y = 1 at x = 2 instead of at x = 0?
My plot.

Expected Output plot

採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Simulation, Tuning, and Visualization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!