There are some similarities between the Matlab code you supplied and C/C++, but there are also a lot of differences. I see no reference to standard Header files and variable declarations seem to be implied rather than defined, no Type definitions. There appears to be no Block bracketing etc.
All in all, it looks to be interpreted code rather than a compiled which can make for a very loose structure, something C/C++ is definitely not.
If you are thinking of taking a course in C/C++ now, to better understand Matlab, then I would say it probably will not help much. But, doing more to understand Matlab now should give you a jump-start in C/C++ for the course next year.
Over many years, I have found that learning another programming language is a very simple process, once you understand programming approach, procedures, portocol and methods learned with your first programming course. The first may have taken many months to understand and get comfortable with, the second may take only a few hours.
If you are already struggling with the Matlab stuff above, then C/C++ is gonna hurt!
Hope that helps with the question.