How to plot a piece-wise function using FPLOT
Mostrar comentarios más antiguos
Hello Please state if possible, how to use fplot to have the graph of a piecewise function. Actually the code below is exactly according to the matlab page: https://uk.mathworks.com/help/matlab/ref/fplot.html
fplot(@(x) exp(x),[-3 0],'b')
hold on
fplot(@(x) cos(x),[0 3],'b')
hold off
grid on
But, it does not work for me. The code plots only the second function, cos(x). Please help me if possible.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Line Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!