this one i can find max
syms x;assume(x, 'Real');f=(2.*x+1).*exp(-x.^2);xMin = -2; xMax = 1; stepSize = 0.01;x = xMin:stepSize:xMax ;y = (2.*x+1).*exp(-x.^2)[val,idx] = max(y) ;val
but with this one i can't
syms x;assume(x, 'Real');f=(2.*x+1).*exp(-x.^2);xMin = -2; xMax = 1; stepSize = 0.01;x = xMin:stepSize:xMax ;y = f[val,idx] = max(y) ;val
Best Answer