MAE 8: Homework 3
Due on Monday, July 18th
CHAPTER 5
Problem 1. Create vector x that has integers 1 through 10, and set vector y equal to x. Plot this straight
line. Now, add noise to the data points by creating a new vector y2 by added individually to
ea
MAE 8  Spring 2015
Homework 1
Instructions: Follow the homework solution template. Put all answers in a MATLAB
script named hw1.m. Submit hw1.m through TED before 9 PM on 04/09/2015. Use double precision unless otherwise stated.
Problem 1: Using the elem
Solution
MAE 8 Home Problem HW02(a)
2) The atomic weight is the weight of a mole of atoms of a chemical element. For
example, the atomic weight of oxygen O is 15.9994 and the atomic weight of silicon
Si is 28.085. Write a script that will calculate the mo
MAE 8  Spring 2015
Homework 4
Instructions: Follow the homework solution template. Put all answers in a MATLAB script
named hw4.m. For this homework, you will need to submit multiple les. Create a zip
archive named hw4.zip. The zip archive should include
MAE 8  Spring 2015
Homework 5
Instructions: Follow the homework solution template. Put all answers in a MATLAB
script named hw5.m. For this homework, you will need to submit multiple les. Create
a zip archive named hw5.zip. The zip archive should include
MAE 8: MATLAB Programming for
Engineering Analysis
Lecture 8
Hieu T. Pham
Spring 2015
Dept. of Mechanical and Aerospace Engineering
Announcement
! Homework 1 solution, grade, gradebreakdown are
posted on TED.
! Regrade: send request to TA Amit within 1 w
MAE 8: Homework 5
Due on Friday, July 29th
CHAPTER 9
Problem 1. For a biomedical experiment, the names and weights of some patients have been stored in a file
patwts.dat. For example, the file might look like this:
Jeff W. Smith 166.2
Helen P. Dee 143.5
G
A Brief Review
The following are just a few of the basics you are expected to know. If youve forgotten or are
confused by any of this, please review on your own or ask for help immediately. In the rest of this
document, the letter C will always denote a c
%atm.m
% simulation of ATM for HW JDG 04
%
% Rough scoring shown below
%
%logical test of correct password info., 20 percent
%check on username not asked for
%
load myatm
atest=false; %initialize logical tests
while atest=false
% user=input('Please enter
MAE 8
 HW#1David T Zimmerman
A092789744
April 5, 2013
CHAPTER 1: problems; 2542
25) create the two vectors twice each. once using the colon operator and once linspace
> 1:10
ans =
1
2
3
4
5
6
7
8
9
10
5
6
7
8
9
10
> linspace(1,10,10)
ans =
1
2
3
4
> 2:5
MAE 8  Winter 2015
Midterm
FORM A
Instructions: Choose the best answer. Use #2 pencil. Completely fill the bubbles. Put your
name, your PID and the form (A or B) on your Scantron. Submit both the exam and
MAE 8 Homework 5, Due February 13, 2013
February 7, 2013
1
Create an x vector that has integers 1 through 10, and set a vector y equal
to x. Plot this straight line. Now, add noise to the data points by creating a
new y2 vector that stores the values of y
MAE 8  Spring 2015
Homework 6
Instructions: Follow the homework solution template. Put all answers in a MATLAB
script named hw6.m. For this homework, you will need to submit multiple les. Create a
zip archive named hw6.zip. The zip archive should include
MAE 8
Solution to Midterm Examination 1, F 14
(Answers are in black font.)
1.(9%) Write down the output from the commands
a.) 3:2:12
3 5 7 9 11
b.) linspace(6,21,6)
6 9 12 15 18 21
c.) length(linspace(1,10)
100
2.(6%) Circle the letter of the correct stat
MAE 8 Homework 6, Due February 21, 2013
February 15, 2013
1
A le called hightemp.dat was created some time ago that stores, on every
line, a year followed by the high temperature at a specic site for each month
of that year. For example, the le might look
MAE 8: MATLAB Programming for
Engineering Analysis
Lecture 1
Hieu T. Pham
Spring 2015
Dept. of Mechanical and Aerospace Engineering
Teaching Staff
! Instructor:
! Hieu T. Pham (h8pham at ucsd dot edu)
! Office hour: Tuesday 1 2 PM EBU II 570
! Teaching A
MAE 8
Solution to Final Examination Sp 13
1.) (20%) Circle choices or write answers in the following multiple choice questions. (Points are
deducted for wrong answers.)
a.) (2%) The commands " i=0;while i<=3 j=i*4; i=i+1; end; j " will give the result:
i.
MAE 8: Homework 5
Due on Friday, July 29th
CHAPTER 9
Problem 1. A For a biomedical experiment, the names and weights of some patients have been stored in a file
patwts.dat. For example, the file might look like this:
Jeff W. Smith 166.2
Helen P. Dee 143.5
MAE 8  Spring 2015
Homework 2
Instructions: Follow the homework solution template. Put all answers in a MATLAB
script named hw2.m. Submit hw2.m through TED before 9 PM on 04/16/2015. Use double precision unless otherwise stated.
Problem 1:
a) Using the c
MAE 8
Solution Midterm Examination 2, F 14
1.) (15%) Write a script that will ask the user to input rst and last names as separate strings and
then create and print a string consisting of a UCSD computer username, consisting of the rst
initial of the rst
HW06
Modification of Problems from Chapter 5
13) Write a script that will read from a file oldfile.dat into a matrix. It will create a
square matrix (same number of rows and columns) by deleting successive rows or
columns as necessary, and then write this
Solution HW1 Exercises from Ch. 1 of Attaway
1) Create a variable to store the atomic weight of silicon (28.085).
> siliconAtWt = 28.085
siliconAtWt =
28.0850
2) Create a variable myage and store your age in it. Subtr
MAE 8
Solution to HW04(a)
Modified Problems from Chapter 3:
23) Whether a storm is a winter flurry, winter graupel, or blizzard is determined by
the snow fall. In inches, a storm is a winter flurry if the snow fall is
MAE 8 F14 HW05
Modified Problems from Chapter 4
18) Assume that you have a matrix of integers mat. Fill in the rest of the fprintf
statement so that this would print the product of every row in the matrix, in the
forma
Solution HW07(a)
Modification of Chapter 7 Problems
10) Write a script that will generate a random integer from 1000 to 2000, ask the
user for a field width, and print the random integer with the specified field width.
MAE 8: Homework 4
Due on Monday, July 25th
CHAPTER 7
Problem 1. A filename is supposed to be in the form filename.integer.ext. Filenames confirming to this
form are, for example: experiment.34.txt, experiment.241.fig, experiment.0001.log. Write
a function
David T. Zimmerman
A09278744
MATH 20F Matlab Assignment #5
Exercise 5.1
(a) List all maximal orthogonal subsets of the above set. What is the maximum
number of nonzero orthogonal vectors that you can find in R3? What about Rn?
Explain.
> dot(v,w)
ans =

HW03(a)
Modifications of Problems in Chapter 2:
24) Write a function called fn that will calculate x as a function of t, as follows:
x = t3 18t2 + sin(t)
Here are two examples of using the function:
> hel
DESIGN STRENGTH OF COLUMNS
3  11
to the frame do not provide resistance to lateral loads shall be included in the design of
the momentframe columns.
Normal practice is to design leaning columns for their required strength with an
effective length factor
MAE 8  Homework 8
CHAPTER 9
Problem 1. For a biomedical experiment, the names and weights of some patients have been stored in a file
patwts.dat. For example, the file might look like this:
Jeff W. Smith 166.2
Helen P. Dee 143.5
Giovanni Lupa 192.4
Kate
MAE 8  Homework 5
CHAPTER 5
Problem 1. Write a script beautyofmath that produces the following output. The script should iterate from 1 to 9 to
produce the expressions on the left, perform the specified operation to get the results shown on the right,
an
MAE 8  Homework 7
CHAPTER 8
Problem 1.
(a) Create a cell array called arr that will contain the following:
Alejandro 11 3 5 7 9 0 0 UCSD2016
8 6 4 2 0 2 Stephanie 1 0 (858) 273 0173
(b) Write an expression that would refer to contents of the cell in t
MAE 8  Homework 6
CHAPTER 6
Problem 1. Write a function called mygalaxy to create a model galaxy and return the assigned mass, coordinates,
and calculated resultant gravitational force for each star. The call to the function should have the form:
[mass c