how can i define a piecewise function in matlab

Antworten (1)

Sean de Wolski
Sean de Wolski am 12 Okt. 2012

0 Stimmen

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);

Kategorien

Mehr zu Entering Commands finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 12 Okt. 2012

Community Treasure Hunt

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

Start Hunting!

Translated by