diff options
Diffstat (limited to '1415/CH1/EX1.3.5/ex5.sci')
-rw-r--r-- | 1415/CH1/EX1.3.5/ex5.sci | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/1415/CH1/EX1.3.5/ex5.sci b/1415/CH1/EX1.3.5/ex5.sci new file mode 100644 index 000000000..e097bdffd --- /dev/null +++ b/1415/CH1/EX1.3.5/ex5.sci @@ -0,0 +1,23 @@ +//Example 6 Page 86
+clc
+clear
+
+disp('a)')
+s2=530//Assigning s2 values
+s1=50//Assigning s1 values
+t2=8//Assigning t2 values
+t1=0//Assigning t1 values
+m=((s2-s1)/(t2-t1));//calculating m value
+disp(m,'the slope is:')//displaying m value
+b=s1-m*t1;//calculating b value
+disp(b,'the intercept value is')//displaying b value
+mprintf( "So, %dt+%d million units ",m,b);//printing the s equation
+
+disp('b)')
+mprintf( "So, %dt+%d million units\n ",m,b);//printing the s equation
+//since value of s=440
+s=440//Assigning s values
+m=60//Assigning m values
+b=50//Assigning b values
+t=(s-b)/60;//calculting time
+mprintf("\nAnnual sales of mobile portable devices will reah 440 millions when s=440 or t=%f years",t);//displaying the time in years
|