This is a draft cheat sheet. It is a work in progress and is not finished yet.
Creating matrices
zeros(m, n) |
Creates a matrix of all zeros of size m-by-n |
zeros(A) |
creates a matrix of zeros with the same dimensions as matrix or vector A |
ones(m, n) |
Creates a matrix of all ones of size m-by-n |
ones(A) |
creates a matrix of ones with the same dimensions as matrix or vector A |
eye(n) |
creates an n-by-n identity matrix |
Dictionaries
d = Dict(key1 => val1, key2 => val2, ...) |
d = Dict(:key1 => val1, :key2 => val2, ...) |
keys(d) # iterator over all keys |
values(d) # iterator over all values |
for (k,v) in d # loop through key-value pairsprintln("key: $k, value: $v") end |
|
|
|
|
|