(Solved) Help with please these are hard
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Ali Ece
am 26 Mai 2021
Kommentiert: Rena Berman
am 29 Jun. 2021
;
' Write a function called threshold that determines the number of terms required for the sum
In other words, your output arguments are terms that gives the number of n required for
sum to exceed a limit; and total that gives that sum.'
2 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
Nikita Agrawal
am 26 Mai 2021
function [number_of_terms] = threshold(limit)
T = 0;
k=1
while T < limit
T = T + 5*k*k-2*k;
k = k+1;
end
number_of_terms=k
end
0 Kommentare
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!