Skip to content

Instantly share code, notes, and snippets.

@pkofod
Created September 29, 2015 17:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pkofod/3453c0390de3afce3df8 to your computer and use it in GitHub Desktop.
Save pkofod/3453c0390de3afce3df8 to your computer and use it in GitHub Desktop.
#Create matrix
A = rand(3,9)
#Sum over rows -> matrix
typeof(sum(A, 1)) == Matrix{Float64} #true
#Sum over cols -> matrix
typeof(sum(A,2)) == Matrix{Float64} #true
#This is expected, but what is the best way to extract the vector? This?
typeof(sum(A,1)[:]) == Vector{Float64} #true
typeof(sum(A,2)[:]) == Vector{Float64} #true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment