How do I solve the error "Brace indexing is not supported for variables of this type"

Hi,

I am attempting to index the variable ‘seq1’ which is a double composed of 12 random numbers between 1 and 9, and then use the output of this indexing to index another variable called ‘rectColor’, which is a cell comprised of 3 numbers defining a grayscale colour, as shown. However, when I run the following code, I get this error:

% Define grayscales
rectColor{1} = [0.1 0.1 0.1];
rectColor{2} = [0.15 0.15 0.15];
rectColor{3} = [0.22 0.22 0.22];
rectColor{4} = [0.30 0.30 0.30];
rectColor{5} = [0.40 0.40 0.40];
rectColor{6} = [0.55 0.55 0.55];
rectColor{7} = [0.7 0.7 0.7];
rectColor{8} = [0.85 0.85 0.85];
rectColor{9} = [1 1 1];

% Substitute numbers for grayscale images
for i = 1:12
seq1(i) = cell2mat(rectColor{seq1(i)});
end

Brace indexing is not supported for variables of this type.

Error in cell2mat (line 42)
cellclass = class(c{1});

Error in perceptual_trial_grayscale (line 223)
seq1(i) = cell2mat(rectColor{seq1(i)});

I would very much appreciate any advice regarding how to solve this issue. Thanks in advance.

rectColor{1} or whatever index is already not a cell, so remove the cell2mat call