MATLAB syntax of (:)

Posted by user198729 on Stack Overflow See other posts from Stack Overflow or by user198729
Published on 2010-04-25T05:12:36Z Indexed on 2010/04/25 5:23 UTC
Read the original article Hit count: 146

Filed under:
|
|
>> I=[2 1 3;3 2 4]

I =

     2     1     3
     3     2     4

>> I(:)

ans =

     2
     3
     1
     2
     3
     4

>> I(1:2)

ans =

     2     3

>> 

Why the first call I(:) returns a vector while the second I(1:2) doesn't which is essentially the same as I(:)?

© Stack Overflow or respective owner

Related posts about matlab

Related posts about syntax