The reason why your “Correct!”, “Incorrect!” or 'Invalid!“ is shown at random places is that MATLAB automatically scales the axes based on the values in the x and y vectors in your plot command. That is, the value limits of x and y axes depend on the minimum and maximum values in the x and y vectors in your plot command. Thus, an absolute position such as (0.4, 0.5) may not be the center of your figure window.
This problem can be solved by using the axis command to set the value limits of x and y axes after you use the plot command to draw the small shapes. For example, if the x and y coordinates of all your points are between 0 and 1, you can use [0 1 0 1] with your axis command. Please see the lecture notes for more details on this command.
The fprintf command. To display the marks for all the students, use a loop statement.
One way to do it is to copy and paste the content of a file into a .txt file on your local computer and then either submit the .txt files or change the file name suffix from txt to m and submit the .m files.