Contents

Aaron Klapheck

% Ch 3. Assignment #6       due 10/17
% Created on October 1, 2007.
% Program Ch3 HW assignment 6.m: Homework assignments taken from the
% book Introduction to Matlab 7 for Engineers by William J. Palm 3.

Problem 2

% Angle measurements are given in radians, with positive numbers
% indicating a c.c.w. rotation from the x-axis and negative numbers
% indication a c.w. rotation form the y-axis.
% Given:
x = -5 - 8i, y = 10 - 5i

% Part a.
Mag_xy = abs(x*y)
Angle_xy = angle(x*y)

% Part b.
Mag_xy = abs(x/y)
Angle_xy = angle(x/y)
x =

  -5.0000 - 8.0000i


y =

  10.0000 - 5.0000i


Mag_xy =

  105.4751


Angle_xy =

   -2.5930


Mag_xy =

    0.8438


Angle_xy =

   -1.6657

Problem 3

% Finding angles.
Angle_a = atan2(8,5)            % a.
Angle_b = atan2(8,-5)           % b.
Angle_c = atan2(-8,5)           % c.
Angle_d = atan2(-8,-5)          % d.
Angle_a =

    1.0122


Angle_b =

    2.1294


Angle_c =

   -1.0122


Angle_d =

   -2.1294

Problem 7

Comment for Holl: For problems 7, 9, and 12 I used my, in your words, "harder method" which you said was OK. For problems 10 and 12 I used the "easier method" described in chapter 3.

% An error will occur when this code is published to Word or
% html, because Belt_Forces requests an input from the user; and
% input cannot be accepted from the user while in Word or html.

% Calls the script file saved under the name Belt_Forces.m.

Belt_Forces 

Error using ==> input
Cannot call INPUT from EVALC.

Problem 9

% Calls the script file saved under the name Temperature_Conversion.m.

Temperature_Conversion

Problem 10

% The function time_of_fall gives you the time it takes
% for an object to reach a certain height when thrown vertically, given
% the height) it reaches, the initial velocity(v_0),
% and the gravitational acceleration(g) due to the planet
% the thrower resides on. (For earth g = 9.8 m/s^2).

% time_of_fall(h, v_0, g) = [t_ascending, t_descending]

% Inputs:
% h measured in length
% v_0 is measured as velocity
% g is measured as acceleration

% Outputs:
% Time.
% Two times are given because the object reaches the given height at two
% different times. Once while ascending and the other while descending.

time_of_fall(100, 50, 9.81)

Problem 12

see figure P12.

% Method 1.
% Calls the script file saved under the name Finding_Length.m.

Finding_Length




% Method 2.

% Figure_P12_Lengths(W, A) = [L, L_Total]

% Inputs:
% W is the width of the figure
% A is the area of the figure

% Outputs:
% L is the length of the figure
% L_Total is the parameter of the figure

Figure_P12_Lengths(6, 80)
The PDF version may be easier to understand.