Which are the alternative codes of heaviside() function?
14 ビュー (過去 30 日間)
古いコメントを表示
Which are the alternative codes of heaviside() function?
0 件のコメント
採用された回答
GandaBerunda
2022 年 6 月 16 日
Hi Tufan,
Instead of using the heaviside() function, you can define your own function with a simple if elseif ladder. If the parameter is less than 0, you can return 0, at equal to 0, return 0.5 and greater than 0 return 1.
Hope it helps.
2 件のコメント
GandaBerunda
2022 年 6 月 18 日
Hi @Sam Chak
One simple approach without if else which I can think of is:
out=(x>0)+0.5*(x==0)
where out is the result, and x is the input
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Install Products についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!