Matlab freezes when using a piecewise function integration
Show older comments
Hello , I need to integrate a function with unknown argument x,y,z. My code is this:
fx = piecewise(-1.5<x<-0.5, x^2/2+3*x/2+9/8, -0.5<x<0.5, -x^2+3/4, 0.5<x<1.5, x^2/2 -3*x/2+9/8);
fy = piecewise(-1.5<y<-0.5, y^2/2+3*y/2+9/8, -0.5<y<0.5, -y^2+3/4, 0.5<y<1.5, y^2/2 -3*y/2+9/8);
fz = piecewise(-1.5<z<-0.5, z^2/2+3*z/2+9/8, -0.5<z<0.5, -z^2+3/4, 0.5<z<1.5, z^2/2 -3*z/2+9/8);
res = fx*fy*fz;
int(res,x,-1.5,1.5);
but it freezes matlab. How can I integrate this function? Thank you.
Answers (1)
Steven Lord
on 9 Jul 2018
0 votes
I'm guessing you're encountering the problem described in this Answer. If so, update your MATLAB installation as described in the Answer.
1 Comment
MS C
on 10 Jul 2018
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!