MatLab - Applying a function to each row in a matrix
问题 I have a matrix with rows of 4 integers, with an unspecified number of columns (depends on the text file). I'm wanting to apply a function to each row of the matrix, independently. The function has 4 inputs, and 2 outputs. I'm trying to use the arrayfun function to do this, but whenever I call the function, I get an error saying: "Not enough input arguments." Here is the function call: [gain,phase]=arrayfun(@(x) GainPhaseComp(B(x,1:4)), 1:size(B)); where b is an n by 4 matrix. Here is the