{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

HW2_ENED1090_AUTUMN_2016(1).docx

HW2_ENED1090_AUTUMN_2016(1).docx - Homework#2 ENED 1090...

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

View Full Document Right Arrow Icon
Homework #2 ENED 1090: Engineering Models I Homework Assignment #2 Due: Week of September 12 th at the beginning of your Recitation Section Instructions: 1. In addition to this HW2 document, you will also need the excel file posted with HW2: HydrogenPeroxide.xlsx. Save this file in your current MATLAB directory. 2. Show your work! Make sure you include MATLAB commands. 3. It is fine to work with other students, but what you turn in must be your own work - not something copied from someone else. Problem 1 : More Practice with 1-d Arrays (Vectors) (a) What MATLAB command will create a vector, t, that starts at 0, increments by 0.75, and ends at 6? Execute the command and display results. MATLAB Command & Results: t=0:.75:6 t = Columns 1 through 4 0 0.7500 1.5000 2.2500 Columns 5 through 8 3.0000 3.7500 4.5000 5.2500 Column 9 6.0000 (b) What MATLAB command will determine how many entries are in vector t? Execute the command and display results. MATLAB Command & Results: numel(t) ans = 9 1
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
Homework #2 Remember, t refers to all of the entries in the vector t. To get to specific entries, we need to index into the vector . For example, t(3) is the 3 rd entry in the vector t. Use indexing for the following problems . (c) What MATLAB command will show the 7 th entry in the vector t? Execute the command and display results. MATLAB Command & Results: t(7) ans = 4.5000 (d) What MATLAB command will show entries 2 through 5 in the vector t? Execute the command and display results.
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 ]}