Question: MEPV 1 0 2 Practical Example 3 . 6 - For loop examples Use a For loop to solve the following problems: a ) Create

MEPV102 Practical Example 3.6- For loop examples
Use a For loop to solve the following problems:
a) Create a table that converts inches to feet. Convert the values ranging between 0 and 24
inches (with increments of 3) to feet.
b) Consider the following matrix values:
x=[45,23,17,34,85,33]
By using a counter how many values are greater than 30?
c) Repeat the previous exercise, this time by using the find command.
d) Use a For loop to sum the elements of the matrix in problem 2. Check your results with the
sum function. (Use the HELP feature to assist you how to use sum).
e) Use a For loop to create a vector containing the first 10 elements in the alternating harmonic
series, i.e.
11,-12,13,-14,15dots-110
MEPV 1 0 2 Practical Example 3 . 6 - For loop

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mechanical Engineering Questions!