Question: Homework Assignment # 2 - Part 1 This assignment is worth 1 0 0 points and consists of two parts. This is Part 1 ,
Homework Assignment # Part
This assignment is worth points and consists of two parts. This is Part which covers matrix
manipulation and program flow control. Part will cover usercontrolled data input and output. Both Part
and are due Tuesday, October on Canvas. Code must be written in MATLAB, be well
documented, and submitted as one file using sections.
The sum of the following geometric series converges to :
cdots
Geometric series is a series of numbers in which the ratio of the next term to the previous one is the same.
In the above case it is Write a script according to the following instructions:
a Using a while loop to check for convergence to The convergence criterion is that difference
between the running total and the convergence value of should be equal to or less than the error
The script should output the number of terms needed and the final sum.
b Repeat part a but use a for loop.
NOTE: Remember that in a while loop the conditional check is at the beginning of the loop and in a for
loop, if a conditional check is needed, it is OK to perform conditional check at the end of the loop, but
use the break command.
Consider the following matrices:
Perform the following operations.
a Create two new matrices U and V respectively using meshgrid function using A and B as input row
vectors.
b Create a new matrix Z by dot multiplying U with V
c Create a matrix which is similar to but this time use the repmat function. Repeat this problem,
but create a matrix Y similar to V using the repmat function.
d Create a matrix Q by dot dividing Z with X Homework Assignment # Part
This assignment is worth points and consists of two parts. This is Part which covers usercontrolled
data input and output. Both Part and are due Tuesday, October on Canvas. Code must be
written in MATLAB, be well documented, and submitted as one M file using sections.
Recall the convergent geometric series from Problem # of Homework # Part # For this problem,
write a script that performs the following:
Prompt the user for input in the form of the number of terms to compute. Check for valid input,
and loop until the user enters a positive number greater than zero. If an invalid number is entered,
display a message reminding the user to enter a positive integer.
Use fprintf to output to the command window each term. See below for an example of what I
would like for the formatted output. Also, output to the command window the total as well as the
number of terms, as shown below. You may use either a while loop or for loop.
Example of the user entering five terms: number of terms
Specify five decimal places to the right of the decimal point for each term and the total, and no decimal
places for the number of terms.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
