size(mat,dim)
- Prints the size of a particular dimension of a matrixlength(arr)
- Output the scalar size of an arrayones(x,y)
- Create a vector/matrix of all oneszeros(x,y)
- Create a vector/matrix of all zerosissparse(mat)
- Returns 1 if the storage class is sparsediag(A), diag(v)
- Returns a column vector of the diagonal elements ofA
or a square matrix with the elements ofv
as the diagonal elements (zeros elsewhere).sparse(A), sparse(m,n)
- Creates a sparse matrix from the matrixA
or anm
byn
sparse matrix of all zeros.find(X>2), find(X>2)=0
- Finds indicies of elements ofX
greater than 2, or finds elements ofX
greater than 2 and sets them to 0isempty(A)
- Determines whether an array is emptyintersect(A,B)
- Returns data common toA
andB
without repetition'norm(S,'fro')
- Calculates the frobenius norm of a sparse matrix.union(A,B)
- Returns the combined data fromA
andB
without repetitionrand(rows,cols)
- Creates a matrix of random numbers of the given dimensions
Snopt methods
snsolve()
- Can't accesssnopt()
- Can't access