I have defined a function like this
function z=agni(x)if x > 0 z=x;else z = x.^2;end
But in the time of plotting plot(x,agni(x)) with x =[-2:.01:2] generate only the curve of x^2. WHY?
plotuser defined fuction
function z=agni(x)if x > 0 z=x;else z = x.^2;end
Best Answer