how can i define a piecewise function in matlab

답변 (1개)

Sean de Wolski
Sean de Wolski 2012년 10월 12일

0 개 추천

Use logical indexing, for this case, you don't even need to apply the logical indices:
h = ~(x-w/2 <= d & d <= x+w/2);

카테고리

도움말 센터File Exchange에서 Entering Commands에 대해 자세히 알아보기

태그

질문:

2012년 10월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by