I have a matrix A and avector y. I want to create a loop which names and defines them the matrix A from A1,…,A10.
for i = 1:10 A{i} = X(y==i)end
Unfortunately this code does not work. It would be nice to end up with a double and not a cell
index variable nameloop variable name
for i = 1:10 A{i} = X(y==i)end
Best Answer