0
Q:

matlab function

function f = fact(n)
    f = prod(1:n);
end
1
%%%% general syntax %%%%%%%%%%%%%
function [return parameters] = name_of_function(attributes)
	%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    body_of_the_function
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    
end
2
function ave = average(x)
    ave = sum(x(:))/numel(x); 
end
0

Tags

New to Communities?

Join the community