"Also, it will be different from picking one value each from A,B,C for 5 times compared to picking all 5 from A, then moving on to B, then C. Now this part does not make sense, since I know matlab finishes generating vector for A and goes to B and C.
The professor is correct about this, but not in any useful way.
Suppose you have to generate two random numbers for each of two different variables, A and B.
Now suppose that you are using a pseudorandom generator. Pseudorandom generators generate one value at a time and then update the state, and use the new state to generate a new value. Let four generated values in a row be designated as R1, R2, R3, R4.
Now if you generate two values and assign them to A, and then generate two values and assign them to B, then A will hold R1, R2, and B will hold R3, R4. But if you generate one value and assign it to A, then a value and assign it to B, then another value for A, then another value for B, then A will hold R1, R3, and B will hold R2, R4. As this A=R1 R3 and B=R2 R4 is not the same as the previous A=R1 R2, B=R3 R4, then your professor is correct that you get different results in MATLAB depending upon the order you assign the values to the variables.
If you use the same random seed before the two series of assignments, you can see this explicitly:
A1(1) = rand(1); A1(2) = rand(1); B1(1) = rand(1); B1(2) = rand(1);
A2(1) = rand(1); B2(1) = rand(1); A2(2) = rand(1); B2(2) = rand(1);
You can see that the exact same values are generated, but the order is different because of how you did the assignments, and so your professor is correct that the order matters.
However, we have to ask whether this is unexpected or a disadvantage compared to the other possibilities.
The exact random pseudo-random generator in use would make a difference as to exactly which values are generated in the above code, but would make no difference at all about the pattern of the outcome. The complaint about the order mattering is like complaining that if you have a queue of values 1, 2, 3, 4, that if you assign the first two to A and the second two to B, that you would get a different outcome than if you assigned them alternately. Well, of course you do.
Consider the contrafactual: what would be needed in a system in order for there not to be a difference in outcome depending upon the order you did the assignments ?
The most direct way that could be true is if the generator only ever returned one value, like if the queue of four values only contained 5, 5, 5, 5, then it does not matter whether you give the first two 5's to A and the second two to B, or if you alternate them. This solution would, of course, promptly fail any reasonable randomness test.
The alternate way that it could happen is if the system could somehow predict the order you are going to use the values in, and then internally hold as many values as needed in order to still generate randomly but somehow the values end up assigned in the same order as if you had assigned sequentially, no matter what order you assign in. This is not something that can be done.