You already have your C1, C2, ..., C512 in a very convenient container making it very easy to access: your cell array. Assuming your cell array is calledC and notB, to get C1:
C{1}
to get C2:
C{2}
etc.
Creating numbered variables is an extremely bad idea. It's just going to make your code more complicated, slower, harder to debug for no gain whatsoever. Seetutorial-why-variables-should-not-be-named-dynamically-eval for a complete explanation
What it looks like from yourcell2mat(B(1)) is that you don't know how to access the data in a cell array. See the tutorials onthe cell array page to learn the difference between() and{} indexing.
Best Answer