# MATLAB INTRODUCTORY EXERCISE Create an M-file named userid_date (e.g. dfjackson_110606) ```MATLAB INTRODUCTORY EXERCISE
Create an M-file named userid_date (e.g. dfjackson_110606)
% MATLAB exercise 1 - Getting Started – Date
% EF105 Section:Monday8:00 TA - Ortal
&gt;&gt; diary lab1ex
&gt;&gt; 4+7+9
&gt;&gt; 4*7+9
&gt;&gt; 4*(7+9)
&gt;&gt; r=10
&gt;&gt; area=pi*r^2
&gt;&gt; r=[1 5 10 50 100]; % Now the variable r represents a list of 5 values.
&gt;&gt; area=pi*r.^2
&gt;&gt; r=1:10;
&gt;&gt; area=pi*r.^2; %Recompute the area for the new length 10 vector r.
&gt;&gt; plot(r, area) % Plot the new area values. Get a smoother plot with more
points.
&gt;&gt; plot(r, area,'x-') % Plot &quot;x&quot; and lines, omit the – to omit the lines.
&gt;&gt; title('My plot of area vs radius on November 6, 2006')
&gt;&gt; ylabel('area in square cm')
% A step size other than 1 can be used to automatically generate an array. For
a step of 1/2:
&gt;&gt; r= -2:0.5:10; % beginning value:step:final value
&gt;&gt; area=pi*r.^2; %Recompute the area for the new values of r.
&gt;&gt; plot(r, area,'o') % Replot with points marked with o and no lines.
% Now you write the coding to calculate velocity and acceleration based on the following
equations:
Velocity = 0.00001 time3 - 0.00488 time2 + 0.75795 time + 181.3566
Acceleration = 3 - 0.000062 velocity2
For times 0 to 120 by 10.
&gt;&gt; diary off % write the diary file and close it
&gt;&gt; exit % exit MATLAB
```