How to create piece wise from matrix?

回答(1 个)

Start with this approach:
f = @(x) (x>622).*4 + ((x>=621) & (x<622)).*3 + ...
then continue with the othher elements.

类别

在 帮助中心 和 File Exchange 中查找有关 Language Fundamentals 的更多信息

产品

版本

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by