Skip to content

Instantly share code, notes, and snippets.

View williamgilpin's full-sized avatar

William Gilpin williamgilpin

View GitHub Profile
{
"cells": [
{
"cell_type": "markdown",
"id": "90ecb153",
"metadata": {},
"source": [
"# Partial differential equations\n",
"\n",
"Requirements\n",
import glob
all_names = glob.glob('*')
all_vals1 = [thing.split('$')[-1] for thing in all_names]
all_vals2 = [float(thing[:-4]) for thing in all_vals1]
@williamgilpin
williamgilpin / Fix MATLAB MEX OSX or macOS.md
Last active December 21, 2017 21:01
MEX file compilation on macOS (OSX) 10.12.6 "Sierra"

When running MATLAB R2014a on MacOS sierra my compiler broke:

mex -setup

Returned this error

Error using mex
 No supported compiler or SDK was found. For options, visit
 http://www.mathworks.com/support/compilers/R2015a/maci64.html
@williamgilpin
williamgilpin / fig_annotate
Created May 1, 2015 21:16
Add parameter values to a figure pdf
import PyPDF2 as pdf
def fig_annotate(filename, params):
'''
Given a figure and a dictionary of values (like simulation parameter values)
associated with that figure, write in the "Keyword" metadata of the PDF the parameter list.
When conducting numerical simulations involving large numbers of parameters, it
can be difficult and confusing to keep track of which parameters are associated with which
figures. This function provides an additional check by allowing paramter values to be written directly