Plotting a Piecewise Function
3 views (last 30 days)
Hi everyone, I'm very new to MATLAB. I'm having a trouble with plotting a piecewise function.
Here is my piecewise function:
y(x)=if x<0, y=0
if x>0, y=1
I need to plot z(x) function. Here is my code:
And this is the error that I got: Error using plot Data must be numeric, datetime, duration or an array convertible to double.
Thanks in advance.