Plot a piecewise function

19 Views Asked by At

Just out of curiosity, I want to plot

$f(x) = 2x$, if $x∈\mathbf{Q}, -5x$ otherwise. Does anyone know of an online plotter that can show this? Alternatively, MATLAB code would be acceptable as well.