MATLAB: Functions function handleMATLAB Hi all. if a have a function: x_out = f(x), where x is some vector. How would i create a new function where a subset of the vector has been given as input: x_out = f(x(3:4)) Thanks a lot Best Answer f34 = @(x) f(x(3:4)); Related SolutionsMATLAB: Subtract function from array Isn't this trivial?f = @cos;x = linspace(0, 2*pi, 100);y = sin(x);y2 = y - f(x);or any other function instead of cos as long as it replies a vector with the same dimensions as the input. MATLAB: How to plot below function f This is how I would do it: f = @(x) (x/4).*((x > 0) & (x < 1)) + (x/3).*(x >= 1);t = linspace(-5, 5);figureplot(t, f(t))grid Related QuestionCould you help me please?How to obtain anonymous function after derivativeAm I getting an error “vectors must be the same length”Applying a negative to the function to find the maximumHow to solve an equation which has another function in it
Best Answer