Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mathematica Data Analysis

You're reading from   Mathematica Data Analysis Learn and explore the fundamentals of data analysis with power of Mathematica

Arrow left icon
Product type Paperback
Published in Dec 2015
Publisher
ISBN-13 9781785884931
Length 164 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Sergiy Suchok Sergiy Suchok
Author Profile Icon Sergiy Suchok
Sergiy Suchok
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. First Steps in Data Analysis FREE CHAPTER 2. Broad Capabilities for Data Import 3. Creating an Interface for an External Program 4. Analyzing Data with the Help of Mathematica 5. Discovering the Advanced Capabilities of Time Series 6. Statistical Hypothesis Testing in Two Clicks 7. Predicting the Dataset Behavior 8. Rock-Paper-Scissors – Intelligent Processing of Datasets Index

Main features for writing expressions

At the beginning, it should be mentioned that Wolfram Mathematica has a very extensive reference system. You can access it by selecting in this menu: Support | Wolfram Documentation:

Main features for writing expressions

Let's get acquainted with some distinctions of Mathematica that will help us to understand the source code in the following chapters.

Let's create our first notebook. When Mathematica starts, you should choose New Document and then Notebook.

In order to compute any expression, press Shift + Enter after entering it. The input expression will be denoted by In and the output by Out:

In[1]:= 1 + 4
Out[1]= 5

Note

In this and other samples, all the formulas will start with In[Number]; you shouldn't type this because it is the number of the input that Mathematica calculates automatically.

All built-in functions always start with a capital letter, as shown here:

Main features for writing expressions

No variables should start with a number, since it will automatically be treated as a multiplication operation. They cannot end with a $ symbol.

If the variable ends with _, then it is a template expression and it can be substituted with anything, for example:

Main features for writing expressions

In Mathematica, there are four types of brackets:

  • Square []: These are used to describe the function parameters
  • Round (): These are used to group expressions and logical elements
  • Curly {}: These are used to describe the elements of arrays, vectors, and data lists
  • Double Square [[ ]]: These are used to allocate a specific item in a data list

In Mathematica, there are two types of assignments: absolute (=) and delayed (:=).

The difference is that in a delayed assignment, the right-hand side of the expression is always recomputed if the function is called. In an absolute assignment, the value that was in place during the assignment is stored.

Main features for writing expressions

In this example, we see that at the time of the second call of variables, x2 adopted the current time value. At the same time, x1 remained unchanged.

In order to use the result of the preceding expression, one can use the % symbol:

Main features for writing expressions

The basis of the Mathematica language is the functional form of all the expressions. In order to see a complete expression, the FullForm function should be used:

Main features for writing expressions

The variables that are not used should be cleared by the Clear function. Otherwise, computation errors will occur:

Main features for writing expressions
You have been reading a chapter from
Mathematica Data Analysis
Published in: Dec 2015
Publisher:
ISBN-13: 9781785884931
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image