Académique Documents
Professionnel Documents
Culture Documents
%ThisisasampleprogramthatplotsDistance=.5GRAVITY*Time^2
function
%Author:MichaelMaloney,MEC101,Fall2012
%CreatedOct17,2012,LastModifiedOct17,2012
Program
GRAVITY=9.81
Time=0:100
Distance=.5*GRAVITY.*(Time.^2)
plot(Time,Distance,Time,Distance)%plotsDistanceversusTime
title('DistanceversusTimeplot');%Titlestheplot
xlabel('Time');%Labelsthexaxis
ylabel('Distance')%Labelstheyaxis
disp(''),disp('......x........y.....'),disp([Time'Distance'])
%presentsdatavalues
Output
0.00090.0397
......x........y.....
0.00100.0491
1.0e+04*
0.00110.0594
0.00120.0706
00
0.00130.0829
0.00010.0005
0.00140.0961
0.00020.0020
0.00150.1104
0.00030.0044
0.00160.1256
0.00040.0078
0.00170.1418
0.00050.0123
0.00180.1589
0.00060.0177
0.00190.1771
0.00070.0240
0.00200.1962
0.00080.0314
0.00210.2163
0.00220.2374
0.00531.3778
0.00230.2595
0.00541.4303
0.00240.2825
0.00551.4838
0.00250.3066
0.00561.5382
0.00260.3316
0.00571.5936
0.00270.3576
0.00581.6500
0.00280.3846
0.00591.7074
0.00290.4125
0.00601.7658
0.00300.4415
0.00611.8252
0.00310.4714
0.00621.8855
0.00320.5023
0.00631.9468
0.00330.5342
0.00642.0091
0.00340.5670
0.00350.6009
0.00360.6357
0.00370.6715
0.00380.7083
0.00390.7461
0.00400.7848
0.00410.8245
0.00420.8652
0.00430.9069
0.00440.9496
0.00450.9933
0.00461.0379
0.00471.0835
0.00481.1301
0.00491.1777
0.00501.2263
0.00511.2758
0.00521.3263
0.00652.0724
0.00662.1366
0.00672.2019
0.00682.2681
0.00692.3353
0.00702.4034
0.00712.4726
0.00722.5428
0.00732.6139
0.00742.6860
0.00752.7591
0.00762.8331
0.00772.9082
0.00782.9842
0.00793.0612
0.00803.1392
0.00813.2182
0.00823.2981
0.00833.3791
0.00843.4610
0.00853.5439
0.00863.6277
0.00873.7126
0.00883.7984
0.00893.8853
0.00903.9731
0.00914.0618
0.00924.1516
0.00934.2423
0.00944.3341
0.00954.4268
0.00964.5204
0.00974.6151
0.00984.7108
0.00994.8074
0.01004.9050