I have a loop that calls a function that writes data into array.
function myfunction(nmax,n)if n==1A = zeros(1,nmax) % called only the first timeendA(1,n)=3end
During second call of the function, the value in the first column becomes 0, while value in the second column is valid, and so on. Also, number of columns is not nmax anymore.
How to preserve data in array during multiple calls of function?