MATLAB: Attempted to access d(2); index out of bounds because numel(d)=1.

index out of bounds because numelwhile loop

Hello, I'm kinda new to MatLab and not much experienced in coding in general and would like to ask for some help. I am trying to create a matrix:
t = [mean(d1), mean(d2),... , mean(d18)];
d1, d2 etc are all seperate matrices of size of 1 row and 5 columns except of d1 which has 3 columns. Although I currently have it set up as above, I want a more tidy way to also get some sort of experience so I tried this:
i=1;
while i < 19;
f(i) = mean(d(i));
i = i+1;
end
t = f(1:18);
But I got this error: Attempted to access d(2); index out of bounds because numel(d)=1. Is it because what I wrote does not make sence? If yes, how can I correct it and in short what does that error mean? Thanks in advance.