Hi,
I dont understand, do you want to create 3D matrix? That is not possible. You already have data in matrix so you can just use: https://www.mathworks.com/help/stats/anova.html
Hope it helps.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!