Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Referring to elements of a table in Mathematica

  1. Mar 4, 2015 #1
    See title.

    I have a table that I've named B. And I want to create table that is essentially the change in values of B. If I was writing this on paper I would say: Let ##b_i \in B##, for ##0\leq i\leq100##. Then let ##c_i \in C## such that ##c_i= b_{i+1}-b_{i}##. I don't know how to say that in Mathematica's language though.

    Another option I guess would be to find a way to assign an indexed variable to each value of the table. With the indexing variable being the same.
     
    Last edited: Mar 4, 2015
  2. jcsd
  3. Mar 4, 2015 #2

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    The help page suggests something along the line of C=B[[2;;100]]-B[[1;;99]], but I cannot test it here.
    Something that certainly works is a loop.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Referring to elements of a table in Mathematica
  1. Mathematica: Tables (Replies: 2)

Loading...