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

10 visualizzazioni (ultimi 30 giorni)
遼 柄澤
遼 柄澤 il 7 Ott 2021
Commentato: 遼 柄澤 il 11 Ott 2021
お世話になります。
y=x (0<=x<=2)
y=0.2x+1.6 (2<=x)
となる関数はどのようにプログラムすればいいのでしょうか?
よろしくお願いします。

Risposta accettata

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

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Symbolic Math Toolbox in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!