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 Exchange2-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