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 mfile, 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. 629667
1. MATLAB InClass 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 mfile 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.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
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 – sidec));
16
end
17
18
Line number
What is the error?
How could it be fixed?
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '11
 Kutson
 TA, Kerry, MEA Team Final

Click to edit the document details