Sideway BICK BlogSideway BICK BLOG from Sideway

A Sideway to Sideway Home

Link:http://output.to/sideway/default.asp?qno=140400005

Elementary Matrix Functions

MatLab: Array Manipulating Functions

Major Reference Source: MatLab Verson 7.0

Since all types of data in MatLab are stored in the form of arrays, MatLab package provides some elementary array manipulating functions.

Elementary Array Manipulating Functions

Besides elementary arithmetic function and common mathematical functions, MatLab package also provides  some basic array manipulating functions for manipulating matrices and arrays.

  • Array Creation and Concatenation Functions

  • Array Indexing Functions.

  • Array Sizes and Dimensions Functions

  • Array Sorting and Reshaping Functions.

Array Creation and Concatenation Functions

Function Description
accumarray(A,B) to construct a new array by accumulating the elements of an array B according to the corresponding index specified by the array A in a row vector form with others are zeros.
blkdiag(A,B,...) to construct a new matrix by placing the specified list of matrices, A,B,...,  diagonally with others are zeros.
eye([A,B],C) to construct a new matrix by placing one diagonally with others are zeros of dimension A-by-B and optional class C or a A-by-A identity matrix, If B is not specified.
false([A,B,..]) to construct a new false array by placing False or logical zeros of dimension according to the specified the list of dimension A-by-B-by-... or a A-by-A square matrix, If only one dimension A is specified. False by itself is short-hand for logical(0)
freqspace  
linspace(a,b,n) to construct a new linearly spaced row vector pf n points with value between and including a and b. The default number of points is 100 points If n is not specified.
logspace(a,b,n) to construct a new logarithmically spaced row vector pf n points with value between and including decades 10^a and 10^b. The default number of points is 50 points If n is not specified. And if b is equal to pi, then the value of points becomes between and including 10^a and pi.
meshgrid  
ndgrid  
ones  
rand  
repmat  
true([A,B,..]) to construct a new true array by placing True or logical ones of dimension according to the specified list of dimension A-by-B-by-... or a A-by-A square matrix, If only one dimension A is specified. True by itself is short-hand for logical(1)
zeros  
cat  
horzcat  
vertcat  

Examples

 IMAGE...  IMAGE... 1

Array Indexing Functions

Function Description
colon  
end  
ind2sub  
sub2ind  

Examples

1

Array Sizes and Dimensions Functions

Function Description
length  
ndims  
numel  
size  
height  
width  
iscolumn  
isempty  
ismatrix  
isrow  
isscalar  
isvector  

Examples

1

Array Sorting and Reshaping Functions.

Function Description
circshift  
ctranspose  
diag  
fliplr  
flipud  
ipermute  
permute  
reshape  
rot90  
shiftdim  
issorted  
sort  
sortrows  
squeeze  
transpose  
vectorize(a) to vectorize an expression a.

Examples

1

 

Previous Month  APR  2014  Next Month
SMTWTFS
12345
6789101112
13141516171819
20212223242526
27282930

Previous Month  MAR  2012  Next Month
SMTWTFS
123
45678910
11121314151617
18192021222324
25262728293031

Sideway BICK Blog

14/04


Copyright © 2000-2020 Sideway . All rights reserved Disclaimerslast modified on 26 January 2013