MATLAB Assignment #2

advertisement

MATLAB EXERCISE2

MATLAB Assignment #2

1. Modify the program from the previous exercise to output time, velocity, and acceleration as a table. Then plot velocity and acceleration on the same plot versus time. Be sure to fully describe the plot. Save this M-file as userid_dateA (e.g. dfjackson_111506A)

2. Write a MATLAB program to calculate the three angles in a triangle given the three sides using the law of cosines.

Include comments in your program, including name, course, filename, description of the assigned problem, and explanations of program features.

 

Display a description of the program

Prompt the user to enter the three sides of the triangle.

Display the three sides as well as the three angles in degrees (include the unit degrees ).

The control of the program is based on a variable called More. More is initialized to 1 for yes. The user should be prompted to enter the value of More. When there are no more cases to test, the user should enter 0.

Test the program for the following cases:

Case a b c

1 20 15 10

2 5 12 13

3 200 100 250

Save this M-file as userid_dateB (e.g. dfjackson_111506B)

Download