{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

PGE 310 - HW 4(2)

# PGE 310 - HW 4(2) - The University of Texas at Austin Fall...

This preview shows pages 1–4. Sign up to view the full content.

The University of Texas at Austin Fall 2011 - PGE 310: Formulation and Solution in Geosystems Engineering Homework #4: If Statements and Loop Structures Due Date: Thursday September 22 nd 2011 Do NOT forget to follow the guideline for submitting homework (Attached to the end of this file) 1. Summation and Product Using Loops (By HAND) Consider the following vector, x , and matrices, A and B : ] 2 8 6 1 2 3 2 5 5 3 4 2 3 1 [ x 2 4 1 2 1 4 1 2 4 A 1 4 1 2 1 2 1 1 2 B Calculate the following by hand and then write (by hand) the equivalent MATLAB loop a. 10 5 2 ) 1 ( i i i b. 3 1 3 1 2 3 ) ) ( ( i j j ji i B A A c. 3 1 1 ) ( i ii i B x d. 3 1 3 1 ) ( j j i ij x A j e. 2 2 2 16 15 .... 6 5 4 3 2 1 Hint: “ symbol is for a product and is analogous to the summation symbol: 10 ... 4 3 2 1 10 ... 4 3 2 1 : . . 10 1 10 1 i i i i g e (30 %)

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

View Full Document