View make_c_map_out_of_screenshot.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [cbar] = make_c_map_out_of_screenshot(impath,crop,column) | |
% ------ Help for make_c_map_out_of_screenshot ------- | |
% | |
% Creates a colorbar from a screenshot of another colorbar. | |
% | |
% How to use: | |
% 1) Make screenshot of the colorbar (Ideally, have the left most column of | |
% pixels right on the colormap) | |
% 2) Save as image file (png works, maybe other formats will not, try it out!) | |
% 3) Put path to file in some variable, e.g.: |
View FastBackslash.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using LinearAlgebra, DualNumbers, BenchmarkTools, SparseArrays, SuiteSparse | |
n = 1000 # size of J and y | |
# make y | |
a, b = rand(n), rand(n) | |
y = a + b * ε | |
# make J | |
spA = sprandn(n, n, 10/n) + I |
View keynoteHL.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
H \ sₖ |
View make_map_NNM.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% The following takes a 3D matrix and averages across depths | |
% You want to see what the z depth are? | |
% I would suggest following Seth John's advice: use explcit names and capitals to show big 3d things | |
DEPTH = z ; | |
depth = squeeze(DEPTH(1,1,:)) ; | |
itoplayers = find(depth < 55) ; % this creates a range of the indices for depth less than (i.e., above) 55m | |
% Here this range is 0m–50m. Check the values before to make sure: | |
depths_top = depth(itoplayers) ; % These are the depth levels [0, 10, 20, 30, 40, 50] |
View neighbors_matrix.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NEIGHBORS_MAP = { | |
0: (0, 0, 0, 0, 1, 0, 1, 0, 0, 0), | |
1: (0, 0, 0, 0, 0, 0, 1, 0, 1, 0), | |
2: (0, 0, 0, 0, 0, 0, 0, 1, 0, 1), | |
3: (0, 0, 0, 0, 1, 0, 0, 0, 1, 0), | |
4: (1, 0, 0, 1, 0, 0, 0, 0, 0, 1), | |
5: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0), | |
6: (1, 1, 0, 0, 0, 0, 0, 1, 0, 0), | |
7: (0, 0, 1, 0, 0, 0, 1, 0, 0, 0), | |
8: (0, 1, 0, 1, 0, 0, 0, 0, 0 ,0), |
View Manifest.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[AbstractFFTs]] | |
deps = ["Compat", "LinearAlgebra"] | |
git-tree-sha1 = "8d59c3b1463b5e0ad05a3698167f85fac90e184d" | |
uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c" | |
version = "0.3.2" | |
[[Arpack]] | |
deps = ["BinaryProvider", "Libdl", "LinearAlgebra", "Random", "SparseArrays", "Test"] | |
git-tree-sha1 = "1ce1ce9984683f0b6a587d5bdbc688ecb480096f" | |
uuid = "7d9fca2a-8960-54d3-9f78-7d1dccf2cb97" |
View OptimProfileCassette.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Here I store more data as I go, | |
# which I could use to plot figures comparing methods | |
# the convergence speed of different methods | |
# I use the Rosenbrock classic example and | |
# Optim.jl as an iterative process which will | |
# call f multiple times to find its minimum | |
# and I plot the convergence vs time | |
using Optim, Cassette |
View spyOCIM.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load Downloads/CTL.mat | |
T = output.TR ; | |
f1 = figure ; | |
spy(T, 'w') ; | |
darkBackground(f1, [0 0 0], [1 1 1]) |
View PlayingWithSymbolsAndExpressions.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f1(x) = x | |
f2(x) = 2x | |
f3(x) = 3x | |
list_methods = [ | |
("method1", :f1) | |
("method2", :f2) | |
("method3", :f3) | |
] |
View NewtonIterator.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example function to find the root of | |
f(x) = [(x[1] + x[2] + 1)^3, (x[1] - x[2] - 1)^3] | |
function f_Jac!(J, x) | |
J[1, 1] = 3(x[1] + x[2] + 1)^2 | |
J[2, 1] = 3(x[1] - x[2] - 1)^2 | |
J[1, 2] = 3(x[1] + x[2] + 1)^2 | |
J[2, 2] = -3(x[1] - x[2] - 1)^2 | |
return J | |
end |
OlderNewer