2つの一次関数を組み合わせたい

6 Ansichten (letzte 30 Tage)
遼 柄澤
遼 柄澤 am 7 Okt. 2021
Kommentiert: 遼 柄澤 am 11 Okt. 2021
お世話になります。
y=x (0<=x<=2)
y=0.2x+1.6 (2<=x)
となる関数はどのようにプログラムすればいいのでしょうか?
よろしくお願いします。

Akzeptierte Antwort

Hernia Baby
Hernia Baby am 7 Okt. 2021
piecewise を使うとシンプルにできます
syms x
y = piecewise(0<=x<=2,x,2<=x,0.2*x+1.6)
y = 
fplot(y)
  1 Kommentar
遼 柄澤
遼 柄澤 am 11 Okt. 2021
ありがとうございます。

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!