Making an M-file


Make a program which adds integers from 1 to 100 using a while-statement, and displays the result.

Save a program as an M-file named ex1.m and execute the file.

>> ex1

s =

        5050

>>