A for loop cycles through the columns of the array you hand it.
If you use
for n=1:365
% some code here
end
n will always be 1x1, but it will go through all values from 1 to 365, because you gave it a vector with 365 columns and it will cycle through them.
If you want n to be an array of numbers from 1 to 365, just type
n=1:365; % for a row vector
n=(1:365)'; % for a column vector