undefined function 'piecewise' for input arguments of type 'double'.
4 次查看(过去 30 天)
显示 更早的评论
Trying to run this piecewise function:
x = [-5:0.1:5];
y = piecewise(x <= 1, ((-2.*(x.^2))+9.*x-7), double(x) > 1, ((10.*sqrt(x))+3));
plot (x,y);
but it gives the following error: "Undefined function 'piecewise' for input arguments of type 'double'."
any fixes please?
thanks in aniticipation.
0 个评论
采纳的回答
Torsten
2022-10-1
syms x
y = piecewise(x <= 1, ((-2.*(x.^2))+9.*x-7), x > 1, ((10.*sqrt(x))+3));
fplot (x,y,[-5 5])
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Assumptions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!