Message Boards Message Boards

0
|
5194 Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:
GROUPS:

Integral from a numerical list

Posted 11 years ago
Hello.
I have a list like Acc={0,1,2,2,3,3,4,5,...}; I want to integral fom Acc. with unit step. (Like Trapzoidal Method with (b-a)=1; as same as Cumtrapz  Command in MATLAB . How can I do it.
Could you please help me?
POSTED BY: Mohammad Zaman
2 Replies
Posted 11 years ago
Accumulate[Most@Acc + Rest@Acc]/2
POSTED BY: Simon Schmidt
Posted 11 years ago
Acc = {0, 1, 2, 2, 3, 3, 4, 5};
Rest[FoldList[Plus, 0, Map[Total[#]/2 &, Partition[Acc, 2, 1]]]]
POSTED BY: Bill Simpson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract