Posts Tagged ‘Subscripts’
The Colon Operator
The colon, :, is one of MATLAB’s most important operators. It occurs in several different
forms. The expression Read More
Subscripts
The element in row i and column j of A is denoted by A(i,j). For example, A(4,2) is the number in the fourth row and second column. For our magic square, A(4,2) is 15. So it is possible to compute the sum of the elements in the fourth column of A by typing Read More
Manipulating Matrices
Matrices and Magic Squares
In MATLAB, a matrix is a rectangular array of numbers. Special meaning is sometimes attached to 1-by-1 matrices, which are scalars, and to matrices with only one row or column, which are vectors. MATLAB has other ways of storing both numeric and nonnumeric data, but in the beginning, it is usually best to think of everything as a matrix. The operations in MATLAB are designed to be as natural as possible. Where other programming languages work with numbers one at a time, MATLAB allows you to work with entire matrices quickly and easily. A good example matrix, used throughout this book, appears in the Renaissance engraving Melancholia I by the German artist and amateur mathematician Albrecht Dürer. Read More
Tags: amateur mathematician, array, break, case, Colon Operator, Command Window, continue, diag, end, example matrix, Expressions, for, full, Functions, help, if, load, m-files, magic, magic Function, magic squares, Manipulating Matrices, matlab, mean, programming, rem, round, sign, Subscripts, sum, title, vectors, ver, what, which, workspace