Show Menu
Cheatography

Julia Cheat Sheat Cheat Sheet (DRAFT) by

For the Julia language 0.6.4

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Introd­uction

println("Hello world")

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

Dictio­naries

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 pairsp­rin­tln­("key: $k, value: $v") end