summaryrefslogtreecommitdiff
path: root/1415/CH1/EX1.3.6/ex6.sci
blob: 718953fcd960dcfc79c67253e4b8358cf625c3dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
//Example 6 Page 86
clc
clear

function s=S(t)//function for s(t)
    s=54*t+20
endfunction
t=[0 0.5 1 1.5 2]//values of t given in question
disp(t,'time(h)')//displaying the t values
s=S(t);//function calling
disp(s,'marker(mi)')//displaying the s values
plot(t,s,'blue')//plotting the graph
xtitle('','Time(hours)','Location(miles)')//naming the axes