Skip to content

Instantly share code, notes, and snippets.

@akellehe
Last active August 29, 2015 14:01
Show Gist options
  • Save akellehe/50b23b0dd365dd90ad23 to your computer and use it in GitHub Desktop.
Save akellehe/50b23b0dd365dd90ad23 to your computer and use it in GitHub Desktop.
Summary of matlab methods used in connie

Matlab methods

  • size(mat,dim) - Prints the size of a particular dimension of a matrix
  • length(arr) - Output the scalar size of an array
  • ones(x,y) - Create a vector/matrix of all ones
  • zeros(x,y) - Create a vector/matrix of all zeros
  • issparse(mat) - Returns 1 if the storage class is sparse
  • diag(A), diag(v) - Returns a column vector of the diagonal elements of A or a square matrix with the elements of v as the diagonal elements (zeros elsewhere).
  • sparse(A), sparse(m,n) - Creates a sparse matrix from the matrix A or an m by n sparse matrix of all zeros.
  • find(X>2), find(X>2)=0 - Finds indicies of elements of X greater than 2, or finds elements of X greater than 2 and sets them to 0
  • isempty(A) - Determines whether an array is empty
  • intersect(A,B) - Returns data common to A and B without repetition'
  • norm(S,'fro') - Calculates the frobenius norm of a sparse matrix.
  • union(A,B) - Returns the combined data from A and B without repetition
  • rand(rows,cols) - Creates a matrix of random numbers of the given dimensions

Matlab operators

  • .* - multiply
  • .^ - power
  • ./ - divide
  • + - addition

Snopt methods

  • snsolve() - Can't access
  • snopt() - Can't access
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment