We will test the code on the MATLAB online basic environment. So head to your page, and type on your command window the following code:
fprintf("Hello World")
Now, hit return, the message
Hello World will be printed (on that same command window).
You can also run your code from a script file. Simply, click the New Script button, from the Home top menu bar. Click on the tab corresponding to that file, then write the same code above:
fprintf("Hello World")
Hit the CTRL + S buttons, then type the name of the file. In our case, it will be hello.m, then click Save.
To run the code, you either hit on the run button from the Editor top menu bar, or on the command window, type in hello, then hit Return.