I'm in a thermal physics course this term where we have had a very...short...introduction to Matlab to say the least.
I have to write a simple code for positive integers (assumed) to calculate the factorial of an array, for example, so that I can plot it against the integer value.
My code so far is:
function z = n_fact(N);
z = N;
x = 0;
z = x.*z;
It can only accept integers...how can I get it so that it iterates individual values of an arary into the function?
Any help would be very much appreciated. Thanks!