Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
不連続関数を定義し(x> 5の場合はf(x)= 5、x <5の場合はf(x)= 6xなど)、間隔を置いて評価する([0 6]など)簡単な方法。
これはどう:
f = @(x) 5*(x>5) + 6*x.*(x<5);
のように
t = 0:0.001:6; f = @(x) 5*(x>5) + 6*x.*(x<5); plot(t,f(t));
定義を変更して、x = 5 の場合を次のいずれかになるように定義することをお勧めします。
f = @(x) 5*(x>5) + 6*x.*(x<=5);
また
f = @(x) 5*(x>=5) + 6*x.*(x<5);