i need help with Scilab

profileosama.z.r
eng_homework.pdf

1

ENGR 112 HOMEWORK ASSIGNMENT #7

For this homework you will be creating scripts in SciLab. You will turn in electronically,

each of the scripts requested below. This is not a group project, so do your own work.

Contact me if you have any questions.

1.) Write a Scilab script named Prob_01.sce, that takes no inputs and returns the

vectors below.

 Use the colon operator to create a vector starting with -9 and ending with 52

in increments of 0.5.

 Use the linspace function to create a vector of length 12 that is linear spaced

from 15 to 70.

2.) Write a Scilab script named Prob_02.sce, that will take in any size vector and

return the following information:

 The sum of the values in the vector

 The smallest number in the vector and its location

 The largest number in the vector and its location

 The average of the vector

 The length of the vector

 The transposed version of the vector

 A 1x2 vector containing the first and last value of the vector

3.) Write a Scilab script named Prob_03.sce, that will take in any size matrix and

return the following information:

 The sum of the values in the matrix

 The smallest number in the matrix and its location

 The largest number in the matrix and its location

 The average of the matrix

 The size of the matrix

 The transposed version of the matrix

 The inverse of the matrix

 A 1x2 vector containing the first and last value of the matrix

2

4.) Write a SciLab script named Prob_04.sce, that takes no inputs and returns a

15x15 matrix of all zeros, with the major diagonal containing the values of 12

using the ones() and diag() functions.

5.) Write a SciLab script named Prob_05.sce, that takes no inputs and returns a

vector solving the following system of equations using matrix operations.

x + y – z = 6

2x – y + 2z = 3

3x + 2y + 5z = 35

6.) Write a SciLab script Prob_06.sce, that will graph each of the following equations

using the subplot command. Remember to name each plot, label the axis with

the correct units, and include the grid.

 Radius = 0 to 10 cm in 0.1 cm increments.

 Volume of a cube = Radius 3

 Area of a Circle = *Radius 2

 Perimeter of a Circle =2*Radius

 Volume of a Sphere = (4/3)*Radius 3