This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: ENGR 195(II) – Spring 2010 Activity 2 Class 5a Activity 2 – Creating a function (Estimated Time: 15 minutes) Through this exercise, you and a partner will create a userdefined function from the beginning. 1. Open function_header_template.m in the MATLAB editor and resave as an appropriately named userdefined function for the task below. 2. Write a MATLAB function that has as arguments the lengths of two sides (a and b) of an oblique triangle and the angle (γ) between them and returns the length of the third side (c) and the remaining two angles (α and β). The length of the third side is given by: γ cos 2 c 2 2 ab b a+ = The angles α and β are given by: =c a α sin sin 1 =c b β sin sin 1 3. For the function: Angles need to be in degrees; Test with vectors 4. Email your script to your partner so your partner can the save the file. a b c β γ α...
View
Full
Document
This note was uploaded on 02/20/2012 for the course ENGR 195 taught by Professor Staff during the Spring '08 term at Purdue.
 Spring '08
 Staff

Click to edit the document details