Semi-trivial Mathematica Question

  • Thread starter MichalXC
  • Start date
  • Tags
    Mathematica
In summary, Mathematica is a software program developed by Wolfram Research that is primarily used for mathematical, scientific, and engineering computations. It has capabilities for data analysis, visualization, and creating interactive documents. Mathematica is a high-level language designed specifically for mathematical and scientific calculations, with built-in functions and algorithms for common tasks. It has its own syntax for inputting mathematical expressions and symbols, and can also handle data analysis and visualization. It is available for Windows, Mac, and Linux operating systems, as well as mobile devices through the Wolfram Cloud platform.
  • #1
MichalXC
41
0
Hi guys,

I have a long list of numbers which has only two values, e.g. {1,1,1,0,0,1,0,1,0,0,0...}.

The list is ordered as a function of time -- chronologically.

I need to see, then, how long the list stays at 1 before going to 0, and then how long the list stays at 0 before going back to 1... etc. etc. until the list terminates.

In my example above, I would expect an output like {3,2,1,1,1,3}.

How can I implement this?

Thanks.
 
Technology news on Phys.org
  • #2
Woo hoo! Found my answer: the http://reference.wolfram.com/mathematica/ref/Split.html" command.
 
Last edited by a moderator:

Related to Semi-trivial Mathematica Question

1. What is Mathematica and what is it used for?

Mathematica is a software program developed by Wolfram Research that is primarily used for mathematical, scientific, and engineering computations. It also has capabilities for data analysis, visualization, and creating interactive documents.

2. What is the difference between Mathematica and other programming languages?

Mathematica is a high-level language specifically designed for mathematical and scientific calculations, with a focus on symbolic computation and visualization. It also has built-in functions and algorithms for common mathematical tasks, making it easier to use for non-programmers.

3. How do I input mathematical equations and symbols in Mathematica?

Mathematica has its own syntax for inputting mathematical expressions and symbols. For example, the equation x^2 + 2x + 1 can be written as "x^2 + 2x + 1" in Mathematica. You can also use the built-in palettes or type in LaTeX-style commands to input equations and symbols.

4. Can Mathematica be used for data analysis and visualization?

Yes, Mathematica has powerful data analysis and visualization capabilities. It can handle large datasets and has built-in functions for statistical analysis, curve fitting, and creating graphs and plots.

5. Is Mathematica only available for Windows or can it be used on other operating systems?

Mathematica is available for Windows, Mac, and Linux operating systems. It can also be used on mobile devices such as iPads and iPhones through the Wolfram Cloud platform.

Similar threads

  • Programming and Computer Science
4
Replies
107
Views
5K
  • Programming and Computer Science
Replies
15
Views
2K
  • Programming and Computer Science
Replies
3
Views
388
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • Programming and Computer Science
Replies
11
Views
837
  • Programming and Computer Science
Replies
6
Views
3K
  • Calculus and Beyond Homework Help
Replies
29
Views
1K
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • Programming and Computer Science
Replies
3
Views
923
Back
Top