Need help with an ENGR 112 hw

profileS4mM4j
112hw7.docx_.docx

ENGR 112 HOMEWORK #7 SPRING TERM

For this homework you need to do all the problems in SCILAB. You will copy and paste your work into an office document and email it to me.

1.

a. (2 points) Create a row vector v1 consisting of the numbers in the ordered set (2, 5, 4, 12, 22) using the square bracket operator.

b. (2 points) Create a row vector v2 consisting of the numbers in the ordered set (1, 3, 5, 7, 9) using the colon operator.

c. (2 points) Create a row vector v3 starting with the element 1, ending with the element 9, with five equally spaced points in the vector. Use linspace.

2. (6 points) Suppose you know all the side lengths of a triangle. You can find the triangle area using Heron’s formula:

where S is the semi-perimeter and is calculated using the formula:

Using SciNotes, set variables ‘a’, ‘b’ and ‘c’, to be 6 feet, 7 feet, and 4 feet, respectively. Continue building the script file that computes the area of the triangle as defined above, and stores the result in a variable called TriangleArea. Include comments that explain the script’s purpose and units of variables where appropriate.

Save the script file with the name ComputerTriangleArea. Run your script file and test your results. Change ‘a’, ‘b’ and ‘c’ to 12 feet, 10 feet, and 8 feet, respectively. Run your script file again, and test your results.

3. (8 points) Make a table that represents the change in area of a circle (AREA = π*r2) and the volume of a sphere (VOLUME = 4/3*π*r3) with respect to the change in radius, ‘r’. Range the value of ‘r’ from 0 to 3 in increments of 0.25.

Copy your work from the SCILAB console with the resulting answers into an office document and email it to me at: [email protected]