Question

1.(10 points) Write a MATLAB program to calculate the sum of first 100 terms of the following series: 100)*)* ...-) Hints: He

0 0
Add a comment Improve this question Transcribed image text
Answer #1

SOURCE CODE IN MATLAB:

term=1; %first term
sum=0; %sum of series
for i=1:100 %summing 100 terms
sum+=term; %adding term
term*=1/3; %since it is GP with r=1/3, we multiply term with 1/3 every loop
end
fprintf("Sum of the series is %7.5f\n", sum); %output

OUTPUT:

octave:7> source(sumofseries.m) Sum of the series is 1.50000

Regards!

Add a comment
Know the answer?
Add Answer to:
1.(10 points) Write a MATLAB program to calculate the sum of first 100 terms of the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • In Matlab Write a MATLAB program to calculate the sum of first 100 terms of the...

    In Matlab Write a MATLAB program to calculate the sum of first 100 terms of the following series: 1+()+()*+(3) + + ... + Hints: Here, n=100

  • Write a matlab program to apply Horner's algorithm to evaluate the sum of the first four...

    Write a matlab program to apply Horner's algorithm to evaluate the sum of the first four nonzero terms of the Taylor series for sin(x) with c=0. Your program should not use any arrays, the exponentiation operator or the factorial function. Print out your program and include the output upon execution for the special case where x = 1. How many nonzero terms of the above Taylor series are needed to guarantee that the sum approximates sin(x) to within .0001 for...

  • Solve using Matlab Write a simple loop to list the squares of the first 10 integers....

    Solve using Matlab Write a simple loop to list the squares of the first 10 integers. Using a simple "while" loop, write a script to sum the series 1 + 2 + 3 + ... such that the sum is as large as possible without exceeding 100. The program should display how many terms are used in the sum. Write a script that takes as input an integer n and creates the n*n matrix A with (ij)th component given by...

  • .using while loops(matlab) Write a program to display the sum of the series [ 9 +...

    .using while loops(matlab) Write a program to display the sum of the series [ 9 + 99 + 999 + 9999 ...] Test Data : Input the number or terms :5 Expected Output : 9 99 999 9999 99999 The sum of the series = 111105

  • 1. (30 Points) Write a MATLAB program that displays "The multiplication of 10 multiplied by integers...

    1. (30 Points) Write a MATLAB program that displays "The multiplication of 10 multiplied by integers of 1 through 15. Display your result back to the user with 2 decimal places (yes, 2 decimal places). You must implement your code using a for loop. The result should have the following format: The multiplication of 10*1 =10.00 The multiplication of 10*2 =20.00 The multiplication of 10'3=30.00 The multiplication of 10*15=150.00 2. (35 Points) Write MATLAB code to prompt a user for...

  • (matlab) 72 (9/10)" Use MATLAB to show that the sum of infinite series 2-1 converges to...

    (matlab) 72 (9/10)" Use MATLAB to show that the sum of infinite series 2-1 converges to in(n). Do this by computing the sum for n = 10, b) n = 50, c) n = 100. Compare the values you got to In(n). Start with "format compact" (which you don't have to enter here) and enter your command-line inputs and outputs into the text area below.

  • In MATLAB Write a script to determine the number of terms required for the sum of...

    In MATLAB Write a script to determine the number of terms required for the sum of the series (5k? – 2k) not to exceed 100,000 using the while loop. Display the number of terms and the calculated sum using fprint () command as follow: The number of terms is 38 and its sum is 93613

  • Use the sum of the first 10 terms to approximate the sum S of the series....

    Use the sum of the first 10 terms to approximate the sum S of the series. (Round your answers to five decimal places.) 4 n 1 n 1 S Estimate the error. (Use the Remainder Estimate for the Integral Test.) error s Use the sum of the first 10 terms to approximate the sum S of the series. (Round your answers to five decimal places.) 4 n 1 n 1 S Estimate the error. (Use the Remainder Estimate for the...

  • 1.1) Write a script in MATLAB that uses Reimann sum with 100 intervals (n=100) to calculate...

    1.1) Write a script in MATLAB that uses Reimann sum with 100 intervals (n=100) to calculate hydrostatic force of water on a triangular gate submerged under water (Figure 1). Give two estimates of this force (lower and upper bound for value of force). Hint: You may need to first find the hydrostatic force on the thin hashed slice by hand using the following information. Hydrostatic pressure P = pgz. p = 10003,= 9.81 m2/s. Note that h = 7-z and...

  • Write a program in Python that approximates the value of π by summing the terms of...

    Write a program in Python that approximates the value of π by summing the terms of this series: 4/1-4/3 + 4/5- 4/7 + 4/9- 4/11 + ... The program should prompt the user for n, the number of terms to sum, and then output the sum of the first n terms of this series. Have your program subtract the approximation from the value of math. pi to see how accurate it is.

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT