MATLAB: Storing unknown matrices size in a single matrix

MATLABunkown matrices size

Hello everyone,
I have a structure and I use strcmp(data.step(i).comment) to extract the matrices which have the number of student in every class.
example of my issue: I am storing the number of students in every class, Math Class=20 students, Bioology class=18 students and so on. (students number is not constant)
I want to write a code to store all matrices which have the students numbers in a single matrix or vector.
Thanks in advance.

Best Answer

If you already have created variable names like that, then you need to concatenate them like this manually
matrix = [math_class, biology, other variables]