CIDER 2022: Tutorial 1: Overview and Setup
William Davis, June 20
This tutorial will be an introduction and overview of the computing tools that you will use. We will cover:
- Python
- Using Google Colab
- MATLAB
If you have experience with computing, take this time to teach a colleague! 🙂
We will be using python in Google Colab notebooks.
Requirements:
- Google account
In the tutorial I will go over:
- Basics of notebooks
- Running pre-prepared notebooks
- Reading/saving data
- Using packages
- Getting new packages
- Q&A (throughout)
Basic features overview of Google Colab
To make a new notebook:
Google Drive -> New -> More -> Google Colaboratory
Check the version with !python --version
Download daisyworld.ipynb from the python/ directory.
- Official documentation
- Stack Overflow
- NumPy for MATLAB users
- Python for R users
- Markdown in Google Colab
- Plotting in Google Colab
- Another python tutorial
- Python Data Science Handbook
We will be using MATLAB in the official IDE (interactive development environment).
Requirements:
- MATLAB with the free 30 day trial (you should have already downloaded and set up this)
In the tutorial I will go over:
- IDE overview
- Using the command window
- Using the editor
- Navigating folders and path
- Documentation
- Scripts and functions
- Using non-library code
- Download package from
https://github.com/williamjsdavis/secn-PR
- Download package from
- Reading/saving data
- Q&A (throughout)
Try these yourself, or work with others 🙂
- Write a function and save it as a
.mfile- The function can be anything you like, e.g. sum the first 1000 primes
- Run that function in the command window
- Run that function from a
.mscript - Write another function that calls the first one. Save that to a file
- Repeat 2&3 for this new function
- Write a script that calls another script
- Why would this be useful? What benefit/difficulty does this have over a function?
- Write a function and then rename it. See what happens
- Write a function and put it at the bottom of a script. Call it at the top of the script. What happens?
- Try writing a function in the middle of a script and see what happens
- Look into anonymous functions
- Anonymous function documentation
- What are the differences between these and regular functions?
- Why might they be useful?
- Run the following code snippet
A = [0,0,0];B = A;B(2) = 1;A- Is this what you expected?
- Try something similar in python and see what happens
- Official documentation
- Summary of basic functions
- MATLAB for python users
- MATLAB for python users cheatsheet
- MATLAB for R users
- Scientific computing presentation
- MATLAB-Julia-Python cheatsheet