Problem Formulation: Let 'x' represents the time axis measured in 'sec' and 'y' represents the 'distance' in m. We have to plot this x VS y data using MATLAB .
Commands Used:
Step1 : Open MATLAB.
Step2 : Enter the values of x as- x = [ 0.5; 1; 1.5; 2; 2.5; 3.01; 3.6 ] and press “Enter” key. Step3 : Enter the values of y as- y = [ 0.26; 1.01; 2.26; 3.99; 6.26; 9.03; 15.31 ] and press “Enter” key. Step4 : For plotting of data, write the commands as- plot(x, y , ‘our design extension') and press “Enter” . Here, we are plotting 3 plots with different colours and designs but they will be plotted gradually. Their commands of our graphs are as follows plot(x, y, 'r--+' ) plot(x, y, ‘-bo’) and plot(x, y, ‘k:d')
Step5 : Give the titles of axis by entering the command as
xlabel( ‘ time sec’) ylabel( ‘distance m') and press “ Enter”. Step6 : Give the title of plot by writing the command in Command Window as- Title( ‘d vs t curve under acceleration') and press “Enter” . Step7 : Showing the points with a particular name, have to enter text in our plot, which is done by the command as- gtext(‘(a)’) gtext(‘(b)’) gtext(‘(c)’) gtext(‘(d)’) gtext(‘(e)’) and gtext(‘(f)’) Press “Enter” after writing every text and then on the plot two cross-sliding line will appear. Choosing a suitable place , leave the cursor and make a simple click . The text will get entered. For each text, repeat this step.
Step8 : Press “ ctrl+s” to save the file. In the opened
dialog box ,name the file as “sanskriti.fig” and select the type of file as “JPEG img(.*jpg) Our plotted graphs will be saved there in the choosen location. Results : The attached file shows our plotted graphs.