diff options
author | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
---|---|---|
committer | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
commit | 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch) | |
tree | dbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /1415/CH1/EX1.2.5/ex5.sce | |
parent | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff) | |
download | Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2 Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip |
initial commit / add all books
Diffstat (limited to '1415/CH1/EX1.2.5/ex5.sce')
-rw-r--r-- | 1415/CH1/EX1.2.5/ex5.sce | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/1415/CH1/EX1.2.5/ex5.sce b/1415/CH1/EX1.2.5/ex5.sce new file mode 100644 index 000000000..7323e28ce --- /dev/null +++ b/1415/CH1/EX1.2.5/ex5.sce @@ -0,0 +1,54 @@ +//Example 5 Page 64
+clc
+clear
+//function for linear model
+function y=r1(t)
+y=57*t+607
+endfunction
+//function for quadratic model
+function y=r2(t)
+ y=-9*t^2+110*t+560
+endfunction
+//function for exponential model
+function y=r3(t)
+ y=608*(1.08)^t
+endfunction
+//function for logistic model
+function y=r4(t)
+ y=930/(1+0.67*(1.7)^-t)
+endfunction
+
+disp('a)')
+t=([0 1 2 3 4 5 6])//assigning values of t
+y1=r1(t)//function caling r1(t)
+disp(t)
+disp(y1)//displaying values of y1
+y2=r2(t)//function calling r2(t)
+disp(t)
+disp(y2)//displaying values of y2
+y3=r3(t)//function calling r3
+disp(t)
+disp(y3)//displaying value sof y3
+y4=r4(t)//function calling r4
+disp(y3)//displaying y4 values
+plot(6,1000,t,y1,'red')//plotting linear graph
+xtitle('Linear Model','x','y')//given title and other labes
+scf//setting current graphic window
+plot(6,1000,t,y2,'blue')//plotting qudratic graph
+xtitle('quadratic','x','y')//setting labels
+scf//setting current graphic window
+plot(6,1000,t,y3,'blue')//plotting exponential graph
+xtitle('Exponential Model','x','y')//setting labels
+scf//setting current graphic window
+plot(6,1000,t,y2,'blue')//plotting logistic graph
+xtitle('Logistic Model','x','y')//setting labels
+
+disp('b)')
+t=10//assigning value of t
+y1=r2(t)//function calling r2
+disp(y1,'Quadratic Model for 2010')//displaying result
+y2=r4(t)//function calling r4
+disp(y2,'Logistic Model for 2010')//displaying result
+
+
+
|