diff options
Diffstat (limited to '1415/CH1/EX1.3.1/ex1.sce')
-rw-r--r-- | 1415/CH1/EX1.3.1/ex1.sce | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/1415/CH1/EX1.3.1/ex1.sce b/1415/CH1/EX1.3.1/ex1.sce new file mode 100644 index 000000000..4c1c68ede --- /dev/null +++ b/1415/CH1/EX1.3.1/ex1.sce @@ -0,0 +1,19 @@ +//Example 1 Page 78
+clc
+clear
+//The function f cannot be linear.If it were, we would have delta f=m*deltax//
+disp(-4/2,'the ratio deltag/deltax is the same each time namely -4/2=')
+disp('hence g is linear with slop m=-2.By the table g(0)=3 hence b =3')
+disp('g(x)=-2x+3');
+x=[0 2 4 6 8 10 12]// taking the x values as in the example
+disp(x,'x')//displaying the same
+f=[3 -1 -3 -6 -8 -13 -15]//taking the f(x) values
+disp(f,'f(x)')//displaying the same
+plot(x,f,'blue')//plotting the f(x) graph with 'blue' colour//
+xtitle('f(x) Graph','x','f(x)')//xtitle gives the title to the graph first parameter is the title, the other two specify the axes names
+g=[3 -1 -5 -9 -13 -17 -21]
+disp(x,'x');//displaying x values
+disp(g,'g(x)')//displaying g(x) values
+plot(x,g,'red')//plotting the graph with colour red
+xtitle('g(x) Graph','x','g(x)')////xtitle gives the title to the graph first parameter is the title, the other two specify the axes names
+
|