Skip to content

Instantly share code, notes, and snippets.

@Proektsoftbg
Created March 27, 2024 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Proektsoftbg/40278eaa3c102545e4ca4143d0f7e971 to your computer and use it in GitHub Desktop.
Save Proektsoftbg/40278eaa3c102545e4ca4143d0f7e971 to your computer and use it in GitHub Desktop.
Multiline switch function
f_1(x) = switch(x < 1; 1; _
x < 2; 2; _
x < 3; 3; _
x < 4; 4; _
x < 5; 5; _
x < 6; 6; _
x < 7; 7; _
x < 8; 8; 9)
f_2(x) = if(x > 9; 8; max(x - 1; 0))
$Plot{f_1(x) & f_2(x) @ x = 0 : 10}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment