M-file' the `MATLAB Editor/Debugger' is opened.
Type the following lines:
x = 0:0.1:2;
y = abs(x.*sin(2*pi*x));
title('f(x)= |x sin(2 pi x)| on the interval [0,2]')
axis([0 2 0 2])
Save the file through the menu `File
Save' under the name `picture.m'.
If you now give the command
picture in MATLAB, then the graph of
on the interval [0,2] will appear.
An other option to save and run a file written in your editor window is to press the button
on top of it. Be careful, that this will overwrite a possible previous file.
It is better to save the commands that generate a figure than to save the figure itself.