Who expects that sorting and summing would be understood by the time MATLAB is started? It might be the case in some establishments, but it is not the case in other establishments. I have seen more than one student indicate that in their degree, using MATLAB was their first programming course; those were primarily engineering students, as I recall.
If people already understood sorting and summing by the time they started using MATLAB, we would not have so many students encountering basic difficulties in implementing these things. We can pontificate that the students "should" already have dealt with such matters in previous courses, but it is clear from the questions that we get that many many students have not had that previous instruction. I don't recall any students yet indicating that they had taken sorts in a previous course but hadn't understood them in that course. It is not our place to tell universities how to run their degree programs. We can grumble, and we can individually choose not to respond, but solving the problems of educational systems in other countries is beyond the influence of anyone I have seen post here.
In some countries, especially those with many more people than available jobs, it is policy in the upper-echelon universities to "throw students off of the deep end" -- to deliberately push students beyond "reasonable" limits and without "reasonable" background, with some courses designed to fail most students. This selects for the "cream" of the students, the ones who do not give in to pressure, who get the tasks done and on time (whether through technical ability or by "learning how to work the system", such as learning who to bribe, or how to cheat without getting caught.) The system is somewhat similar to that used for medical students in Canada and the USA, with their very strenuous "residencies", which at least has the excuse of selecting students who will be able to work through hardships disasters.
I know of at least one well-known US university that uses (or used) this kind of technique for Computer Science, with the first and second year courses explicitly designed to impersonally weed large classes down to much much smaller numbers, with the real teaching reserved for third and fourth year students. (But even that university was no-where near as harsh as what I observe in some countries.)
Yes, "Each problem/class/unit will have a set of aims and objectives". Unfortunately a lot of the time, the instructor fails to make those aims and objectives clear... or even to mention them at all. I know someone who has been researching these issues, and who teaches workshops to university classes to make students aware of these issues, to help the student recognize the need for clarifications and to "negotiate" with the instructor about the requirements. This person spends part of their time operating a research help desk at a university; they have indicated to me that first and second year students almost never have any idea what the purposes of any given assignment are, and that third year students are usually fairly weak in this area, with it being uncommon (but not unknown) for anyone below masters level to ask a "good" question.
It could be that perhaps the "best" question I asked in university was "Why is learning COBOL mandatory for first term computer students? Since the first language they learn is going to provide the foundation for all future learning, why would you want to weigh them down with so many decades of bad programming?". (Unfortunately, the answer was "So that they can get summer jobs with industry.")