How to use function like `min` in symfun?(I got an error)
Show older comments
For example, i want to create a symbolic function: f(x,y) = min(x-1,y+1);
when f(x,y) = x+y, everything is ok, but when it comes to min, error occured.
syms x y
f = symfun(min([x-1 y+1])),[x y])
I got error like this:
"Unable to convert expression into double array."
Help...
Accepted Answer
More Answers (1)
Walter Roberson
on 26 Apr 2020
syms x y
f = symfun(piecewise(x-1<=y+1, x-1, y+1),[x y])
1 Comment
Liming Fang
on 26 Apr 2020
Categories
Find more on Assumptions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!