hw12_engr13200_s11

hw12_engr13200_s11 - ENGR 13200 Ideas to Innovations Part...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
ENGR 13200 Ideas to Innovations Part II Spring 2011 HOMEWORK #12 Due: Class 12b To be submitted in Class 12B: Individually: 1. A print out of your MATLAB m-file, activity11a.m. (problem 1) 2. A print out of your response to problem 2. (problem 2) 3. A print out of your three errors for problem 3. (problem 3) 4. A print out of your three errors for problem 4. (problem 4) 5. A print out of your MATLAB function file, goldenratio_ yourlogin .m. (problem 5) To be uploaded prior to coming to Class 12B: Individually: 1. MATLAB files activity11a.fig and activity11a.m. (problem 1) 2. MATLAB function file, goldenratio_ yourlogin .m. (problem 5) Team: 1. Final version of your memo to the MEA portal. (problem 6) 0. Reading Assignment Ideas to Innovation Textbook: Chapter 27: pp. 629-667 1. MATLAB In-Class Activity This is to be completed individually. This problem is added to your homework grade. Complete activity 1 from class 11a. Deliverable: Hardcopy printout of your MATLAB m-file activity11a.m. Upload your MATLAB files (activity11a.fig and activity11a.m) to your Instructor’s Assignment Drop Box on Blackboard. 2. Graphical User Interface (GUI) Reflection This is to be completed individually. This problem is added to your homework grade. During Class 11a and 11b you were shown the basics regarding graphical user interfaces in MATLAB. Based upon your experiences, do you think that a GUI will be helpful in your project? If yes, explain how you plan to incorporate them in your project. If no, explain why they do not fit into your project plans. Deliverables: Handwritten answer to the question above.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Spring 2011 3. Review – Conditional Statements This is to be completed individually. This problem is added to your homework grade. The area of a triangle can be calculated from the lengths of the three sides using Heron's formula: ( 29( 29( 29 A s s a s b s c = - - - where 2 a b c s + + = Identify THREE errors in the code below using the table after the code. Clearly indicate the line number of the error, describe the error and how it could be fixed. Each error counts as one, even if there are multiple errors on the same line. Line 1 function [heron_area] = TriArea(side_a,side_b,side_c) 2 % This function calculates the area of a triangle given the lengths of the % three sides using Heron's equation. 3 % 4 % INPUT ARGUMENTS: side_a = the length of side a of the triangle 5 % side_b = the length of side b of the triangle 6 % side_c = the length of side c of the triangle 7 % 8 % OUTPUT ARGUMENTS: heron_area = the area of the triangle 9 10 % ---- Calculation Section ---- 11 if side_a && side_b && side_c <= 0 12 fprintf('One of the sides is negative or zero') 13 elseif 14 s = (side_a+side_b+side_c)/2; % the half perimeter of the triangle 15 heron_A = sqrt(s*(s – side_a)*(s – side_b)*(s – side-c)); 16 end 17 18 Line number What is the error? How could it be fixed?
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 6

hw12_engr13200_s11 - ENGR 13200 Ideas to Innovations Part...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online