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 function:
function [gain,phase] = GainPhaseComp(InAmp,InPhase,OutAmp,OutPhase)
gain = 20*log10(OutAmp\InAmp);
phase = (OutPhase - InPhase);
end
Any help would be greatly appreciated!