Skip to main content

Posts

Showing posts from October, 2018

Introduction to Wolfram Mathematica

Free-form inputs To compute, press SHIFT + ENTER In[1]:= 3 + 9 SHIFT + ENTER Out[1]:= 12 To suppress output, add ; after the line In[1]:= 3 + 9; SHIFT + ENTER -> no output You can execute multiple lines at once In[1]:= a = 2 b = a + 2 c = b ^ 3 SHIFT + ENTER Out[1]:= 2 Out[2]:= 4 Out[3]:= 64 Starting from now, when we have output, it means that in the end of the previous line, we press SHIFT + ENTER . To get the most recent output, use % In[1]:= 3 + 9 Out[1]:= 12 In[1]:= % + 5 Out[1]:= 17 Basics in Programming Variable A variable starts with letters. If you want, you may add numbers into the variable name. It is much better if you start the variable name with lowercase In[1]:= myVariable123 = 2 Out[1]:= 2 Please notice how I join the two words and the number into a single word. If you put space between the variable name, it will indicate multiplication In[1]:= x = 3; 5 x x Out[1]:= 45 To clear the variab