i did this but cant sure about my howemork question 2. can anyone help me?

1 view (last 30 days)

Answers (1)

Geoff Hayes
Geoff Hayes on 19 May 2020
Emre - the question is asking you to write a function called threshold that determines the number of terms required for the sum of the series (see pdf) to exceed an input variable called limit. That means that you need to keep summing up your terms until that sum exceeds the limit
if summa > limit
break;
end
You probably don't want to use a for loop since you don't know how many iterations are necessary until that limit is exceeded. Also, in your code, you use k as your for loop step variable and also use it to for a calculation. It isn't always a good idea to re-use variables in this way as it could lead to unpredictable results so consider using a different variable name (for one of these two) or just move the calculation to the line of code where you update the sum.

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!