Why does it become four number in a line?
Show older comments
>>A(0 0 0;0 2 2)
>>A(1:2)=[]
A=
0 2 0 2
Why A becomes 0 2 0 2 not becomes (0 2;0 2)?
Accepted Answer
More Answers (1)
TADA
on 1 Mar 2019
you accessed a 2d matrix with linear indexing,
If you want to retain the dimentions of your matrix use subscripts instead:
A(:,1) = []
A =
0 0
2 2
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!