Text-only Table of Contents (frame/ no frame)
(9) Array Subscripting and Indexing Previous Top Next

More Array Subscripting and Indexing in MATLAB



Array indices must be integers and can refer to:

Example of Matrix Indexing

Try:
>> first_mat
>> A([ 1 7 2; 3 6 2])

ans =  4.000      1.200      8.000
         7.2          10.0000    8.000

>> A(1:5,5)
>> A(:,5)
>> A(21:25)
>> A(1:end,end)
>> A(:,end)
>>A(21:end)'
>> A(4:5,2:3)
>>A([9 14; 10 15])

>>B= find(A>5)
>> C=size(A)


Useful Subscripting commands:














Previous Top Next


Array_Subscripting_and_Indexing.src  last modified Feb 11, 2014 Introduction Table of Contents
(frame/no frame)
Printable
(single file)
© Dartmouth College