Q:

Can't get function to work

I am unable to write a function to generate a matrix.
I keep on getting the error "Not enough input arguments" when I try to run the following:
function B=generate_matrix(n)
    B=zeros(n,n);
    %I'll add more stuff to the function once I can get it to work
end
Does anyone know what I'm doing wrong? I've checked online already and don't know what I'm doing wrong.

A:

Write file for the function
function B = generate_matrix(n)
B = zeros(n,n);
end 
then, in the command window, 
B = generate_matrix(3)
this should generate the 3x3 zero matrix. I think your code is working.

