I'm sorry that this is an extremely basic question that people might get irritated by, but I am new and I am trying to do some scripting. I want to declare a function that makes an array for concentration values of a serial dilution. As far as I can tell, I am following the syntax matlab gives for function EXACTLY, but it still gives an error when i call the function with what should be valid parameters.
For example, this should return a 24 by 1 array that is [ 25, 15, 9, ... ]
a = serialdilution(25, 1.6666, 24)
Error: File: serialdilution.m Line: 1 Column: 28
with this function definition in the \MATLAB path named serialdilution.m
function concentrations = serialdilution(maxconc, factor, n)
concentrations(n-i-1) = maxconc*(1/factor^(i-1);
concentrations = concentrations.';