set. How to do it using matlab?
2 ビュー (過去 30 日間)
古いコメントを表示
Hello!!
could someone help me build this system in matlab?
how could it be done?
0 件のコメント
回答 (1 件)
Walter Roberson
2020 年 10 月 29 日
logical indexing, if you are processing a vector of x values.
piecewise() if you have the symbolic toolbox and you are building a function or formula
If you need an anonymous function, then consider the form
value1 .* (condition1) + value2 .* (condition2)
such as
2.*(x>3) + -5*(x<=3)
that would implement: "2 if x > 3, -5 if x <= 3"
You do not actually need two conditions if you are creative enough: you have f(x) = -f(-x)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Symbolic Math Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!