Plotting a function with three regions

Hi,I have been plotting various functions on matlab but I can’t wrap my head around this one, how can I write or plot this function when it has three values in three regions?

댓글 수: 1

Torsten
Torsten 2023년 5월 1일
편집: Torsten 2023년 5월 1일
Use "piecewise" or define
g = @(n) -3*(n>=-4 & n <=2) + 2*(n>=3 & n<=5)

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품

질문:

2023년 5월 1일

답변:

2023년 5월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by