MATLAB: Create a function handle extracting pieces from a matrix function handle

function handlematrix manipulation

I created a Matrix function using function handle @ like
A=@(x) [1 2 x; 2*x x.^2 3]; %it's an example
i need to create another function extracted from the previous one
B=@(x) A(x) without the second column
therefore size(A)=2×3 and size(B)= 2×2;
if it wasn't for the handle: B=A(:,[1 3])
ty for your help

Best Answer

Starting from your example
A = @(x) [1 2 x; 2*x x.^2 3];
you probably realized that this command is not allowed
B = @(x)[A(x)(:,1),A(x)(:,3)]
However, you can use this command:
B = @(x)[A(x)*[1;0;0],A(x)*[0;0;1]]