Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #3814

Re: Piecewise function in gnuplot?

From Karl Ratzsch <mail.kfr@gmx.net>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: Piecewise function in gnuplot?
Date 2017-11-08 18:21 +0100
Organization solani.org
Message-ID <otveef$95j$1@solani.org> (permalink)
References <16c3d30b-38eb-4028-9a9a-4a30b869be1a@googlegroups.com>

Show all headers | View raw


Am 08.11.2017 um 14:21 schrieb Lawrence Bottorff:
> I've seen a gnuplot treatment of piecewise functions:
> 
> http://www.gnuplotting.org/defining-piecewise-functions/comment-page-1/ 
> 
> but I need something that looks like this:
> 
> https://www.khanacademy.org/math/algebra/absolute-value-equations-functions/piecewise-functions/v/piecewise-function-example

What's the difference between what's shown on the two pages (sorry, not
watching that youtube video)? You can of course let the ternary operator
return the result of any kind of valid mathematical expressions, not
just constants.

  f(x) = x**2 > 5 ? -x**2 : 2*x

  g(x) = x < 0 ? h(x) : i(x)

That what you mean?

Best, Karl


Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Piecewise function in gnuplot? Lawrence Bottorff <borgauf@gmail.com> - 2017-11-08 05:21 -0800
  Re: Piecewise function in gnuplot? Karl Ratzsch <mail.kfr@gmx.net> - 2017-11-08 18:21 +0100
    Re: Piecewise function in gnuplot? Lawrence Bottorff <borgauf@gmail.com> - 2017-11-08 11:58 -0800
      Re: Piecewise function in gnuplot? Karl Ratzsch <mail.kfr@gmx.net> - 2017-11-09 08:13 +0100

csiph-web