A Matlab script file (also known as M-files because the Matlab script file must have the extension. M) is a method to perform a series of instructions Matlab without typing any commands from the keyboard. This allows you to automate tasks, and allows you to write script file that a student can achieve without knowing the details of the Matlab programming. we can then begin creating the following script file by selecting File-New-MFile menu of Matlab. Give it a name, such as test1.m:
disp (’Howdy Folks’)
a = input (’Enter a number to Square’);
b = a * a;
disp ([’The Result is’ num2str (b)])
Now just type in the box test1 Matlab and Matlab prompt will ask you a number, the square and then display the result.
to go into that click the link below :