MATLAB: Matrix as input argument of a matlab function

function

I want to pass two matrices A and B as input arguments to a function. but I am getting the error "Not enough input argument" I tried a simple function as follows but still I am getting the same error,
function [ C ] = add( A, B )
%ADD TWO MATRICES A AND B
C=A+B;
end

Best Answer

Are you calling the function from your command window, or are you just hitting "run" in your editor? From the command window, the function works fine for me.
Related Question