0

If I have a matrix:

A = [ 1 2 3 4 5 6] 

how do I create another matrix from that so that it is:

B = [ 3 4 5 6] 

Basically, I just want to take the first row off of a matrix and assign the remaining to a new matrix. I tried:

B = A ([2,:],:) 

but that didn't work... Any help would be greatly appreciated, thanks!

1
  • 1
    Just a sidenote, if you want to select arbitrary rows, then do as follows: B=A([1 3 5 8 10],:). This will select only 1st, 3rd, 5th, 8th and 10th row. Commented Jun 1, 2015 at 19:34

1 Answer 1

2

You're close!

You can do like so:

B = A(2:end,:) 

where you can use end to indicate the last column index of the array.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.