I'm struggling in finding a way to declare a function with two different behaviours in the following way:
$$f(x) = \begin{cases} \frac{\sin(x)}{x} & \text{if } x \neq 0, \\ 1 & \text{if } x = 0. \end{cases} $$
Thanks
I'm struggling in finding a way to declare a function with two different behaviours in the following way:
$$f(x) = \begin{cases} \frac{\sin(x)}{x} & \text{if } x \neq 0, \\ 1 & \text{if } x = 0. \end{cases} $$
Thanks
Copyright © 2021 JogjaFile Inc.
Here is a simple example:
Here is a vectorised example:
Note that in the above it would make more sense to compute
!idx, but the purpose is here to illustrate.