Answers for "how to write a piecewise function in matlab"

0

how to write a piecewise function in matlab

See More Methods at
https://www.entechin.com//how-to-plot-a-piecewise-function-in-matlab/

clear all;
close all;
clc;
syms x;
y=piecewise(-5<=x<=0,(2*x)+3, (0<x) & (x<2), x, (2<=x) & (x<=5),1-x);
fplot(y);
xlabel('X-axis')
ylabel('Y-axis')
title('Piecewise Function f(x)')
grid on;
Posted by: Guest on September-02-2021
-1

how to write a piecewise function in matlab

//See More Methods at www.entechin.com

clear all;
close all;
clc;
syms x;
y=piecewise(-5<=x<=0,(2*x)+3, (0<x) & (x<2), x, (2<=x) & (x<=5),1-x);
fplot(y);
xlabel('X-axis')
ylabel('Y-axis')
title('Piecewise Function f(x)')
grid on;

//See More Methods at www.entechin.com
Posted by: Guest on September-02-2021

Code answers related to "how to write a piecewise function in matlab"

Browse Popular Code Answers by Language