What is the problem with the heaviside function?
古いコメントを表示
fun =
@(p,x)p(1)*heaviside(x-p(2))
Undefined function 'heaviside' for input arguments of type 'double'.
採用された回答
その他の回答 (1 件)
The error means that Matlab cannot find the heaviside function. Try
which heaviside
to locate the function. The heaviside function is part of the Symbolic Math Toolbox. If you do not have this TB, you can write your own heaviside function
function y = heaviside(x)
y = (x > 0) + 0.5*(x == 0);
1 件のコメント
Dief Gerard
2022 年 2 月 10 日
@Thorsten Thanks for your answer. It helped me debug my code.
カテゴリ
ヘルプ センター および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!