Filter löschen
Filter löschen

Can someone help me with a question to do with sequences and creating a function file that find n terms of sequence

1 Ansicht (letzte 30 Tage)
Can someone show me the function file that would calculate the first n terms of this sequence a_i=a_(i-1)+3i as well as the sum of the first n terms please!

Akzeptierte Antwort

Roger Stafford
Roger Stafford am 12 Dez. 2016
Bearbeitet: Roger Stafford am 12 Dez. 2016
a = a_0 + cumsum(3:3:3*n); % The sequence of first n terms
s = sum(a); % The sum of these

Weitere Antworten (0)


Mehr zu Get Started with MATLAB 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!

Translated by