Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
5.2 kB
0
Indexable
Never
1. Determine the result of the following calculations using SCILAB if a = 2.3, b = -2.3, c= π/2, x =
2/π, and y = √3:
(a2 + bc + x)

a=2.3;
 b=-2.3;
 c=%pi/2;
 x=2/%pi;
 y=sqrt(3);
 d=(a^2+b*c+x);
disp(d)

2.Determine the result of the following calculations using SCILAB if a = 3.3, b = -5.3, c= π/2, x =
  2/π, and y =
 √3:sin(c) + y/c

a=3.3;
 b=-5.3;
 c=%pi/2;
 x=2/%pi;
 y=sqrt(3);
 d=sin(c);
 p=(sin(c)+y/c);
 disp(p)



3.Determine the result of the following calculations using SCILAB if a = 1.3, b= 7.3, c= π/2, x = 2/π,
and y = √3:

a=1.3;
 b=7.3;
 c=%pi/2;
 x=2/%pi;
 y=sqrt(3);
 d=(a+c)/(x+y);
disp(d)


4.Determine the result of the following calculations using SCILAB if a = 4.3, b= -2.3, c= π/2, x = 2/π,
and y = √3:

a=4.3;
 b=-2.3;
 c=%pi/2;
 x=2/%pi;
 y=sqrt(3);
 d=cos(c);
 e=log10(x);
 p=(1/(e+d));
disp(p)


5.Determine the result of the following calculations using SCILAB if a = 7.3, b= -2.3, c= π/2, x = 2/π,
and y = √3:

a=7.3;
 b=-2.3;
 c=%pi/2;
 x=2/%pi;
 y=sqrt(3);
d=((a+c)*3/b);
 disp(d)

6.Take the two vectors u and v form user and calculate the following operations using SCILAB:
w = u+v
r = u./v


u=[1 2 3]
 v=[4 5 6]
 w=(u+v)
 r=(u./v)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

7. Take the two-matrix u and v form user and calculate the following operations using SCILAB:
w = u+v
r = u./v

 u=[1 2 3;4 5 6;7 8 9]
 v=[1 2 3;4 5 6;7 8 9]
w=(u+v)
 r=(u./v)



8. Take the two vectors u and v form user and calculate the following operations using SCILAB
t = v.*u
t=v’+u

u=[1 2 3]
 v=[4 5 6]
 t=(u.*v)
 




9. Take the two-matrix u and v form user and calculate the following operations using SCILAB:
1. t = v’.*u’ 2. t=v’+ u’



v=[1 2 3;4 5 6; 7 8 9]
 u=[1 2 3;4 5 6;7 8 9 ]
 v'
 u'
 t=(v'.*u')
 t=(v'+u')


:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

10. Take the two-matrix x and y form user and calculate the following operations using SCILAB:
1. x*y' + y'*x
2. x*y' + y'*x

 x=[1 2 3;4 5 6;7 8 9]
 y=[1 2 3;4 5 6;7 8 9]
 
 x'
  y'
 t=(x*y'+y'*x)
t=( x*y' + y'*x)

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

11. calculate the area of circle and triangle using SCILAB
area of circle:

r=2;
 a=((%pi)*r*r);
 disp(a)

area of triangle:

 b=2;
h=4;
 a=(1/2*(b*h));
 disp(a)

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

12. calculate the area of square and rectangle using SCILAB


 a=2;
  areaofsquare=(a*a);
  disp(areaofsquare)
  b=3;
  areaofrectangle=(a*b);
  disp(areaofrectangle)


:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

13. calculate the area of Parallelogram and Trapezium using SCILAB

area of parallelogram :

 b=2;
 h=3;
 area=(b*h);
 disp(area)

area of trapezium:

 a=2;
 b=3;
h=4;
 area=(1/2*(a+b)*h);
disp(area)



14. calculate the area of Ellipse and Cube using SCILAB

area of ellipse:

a=2;
 b=3;
 c=(%pi);
area=(a*b*%Pi);
 area=(a*b*c);
disp(area)


area of cube:

 a=2;
 area=(6*a*a);
disp(area)


15. calculate the area of Rectangular prism and Cylinder using SCILAB

area of rectagular prism:

a=2;
 b=3;
 c=4;
 area=(2*(a*b)+(b*c)+(c*a));
disp(area)

area of cylinder:

r=2;
 h=3;
 c=(%pi);
 area=(2*c*r*(r+h));

disp(area)




16. calculate the area of Cone, Sphere and Hemisphere using SCILAB

r=2;
 h=3;
 a=(%pi);
 areaofcone=(a*r*(r+sqrt(r^2+h^2)));
 disp(areaofcone)
 areaofsphere=(4*a*r*r);
disp(areaofsphere)
 areaofhemisphere=(3*a*r*r);
 disp(areaofhemisphere)


17. print the series of 1 to 10 numbers using SCILAB

1:10
 ans  =

   1.   2.   3.   4.   5.   6.   7.   8.   9.   10.

--> for(i=1:10);
  > disp(i)
  > end

   1.

   2.

   3.

   4.

   5.

   6.

   7.

   8.

   9.

   10.



18. print the series of 1 to 10 which increments in steps of 2 using SCILAB

1:2:10
 ans  =

   1.   3.   5.   7.   9.

--> for(i=1:2:10);
  > disp(i)
  > end

   1.

   3.

   5.

   7.

   9.



19. Print addition of numbers from 1 to 10(using for loop) Using SCILAB

 a=0;
 for(i=1:10)
  a=a+i
 disp(a)
 end



20. print the series of 1 to 10 numbers (using for loop) using SCILAB


 for(i=1:10);
  disp(i)
  end



21. print even numbers between 0 to 10 (using for loop) using SCILAB


0:2:10

--> for(i=0:2:10);
  > disp(i)
  > end



22. print odd numbers between 0 to 10 (using for loop) using SCILAB


1:2:10
 

 for(i=1:2:10)
  disp(i)
 end