Matlab is printing comments and other contents of a script to command window

Viewed 176

Below is a script in which I sum elements of a vector. My problem here is that whenever I run the script, Matlab prints everything onto the command window. That is, it prints the comments, and everything else.

I only wanted to print the sum as an output, that is why I did not put ; after y = sum(x).

Can somebody help me prevent Matlab from printing the comments and contents of the script, except the ones I only want to print? Below is the script

%simple script
%this script sums the number of elements in a vector.
x = 1:2:10;
y  = sum(x)

Here is the output in command window output

1 Answers
Related