Question about Notation for Creating Matrices
1 view (last 30 days)
Show older comments
I am currently reading a piece of MATLAB code in which matrices are created, but I am not sure what exactly the notation with commas and colons denotes and was wondering if someone could clarify. I think in the code a matrix A is created and then successive rows and columns are added to it.
So for example, there is a part which is in the form A(i,j) so I take it that means to create a normal i x j matrix, but in the part above there is something in the form A(i,j:k), so exactly what kind of matrix is being created here with the colon in the middle?
1 Comment
Stephen23
on 9 Feb 2019
Edited: Stephen23
on 9 Feb 2019
"...I am not sure what exactly the notation with commas and colons denotes and was wondering if someone could clarify."
Basic MATLAB concepts, such as the purpose of commas and semi-colons when defining matrices, are explained in the introductory tutorials:
"...but in the part above there is something in the form A(i,j:k), so exactly what kind of matrix is being created here with the colon in the middle?"
Basic MATLAB concepts, such as how to use the colon operator to define vectors and use indexing, are explained in the introductory tutorials:
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!