Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

removing vector entries 1

Status
Not open for further replies.

jedynygucio

Civil/Environmental
Aug 23, 2006
1
Hello,
I have a common problem which I have not yet managed to solve. If, for example, I have a matrix A = [1 2 3 4 5 6] and I want to remove the 3rd, 4th and 5th rows, is there a command that will allow me to end up with A = [1 2 6], with the vector reshaped and all the unwanted dimensions removed?
I would appreciate any help on the matter very much, I am sure it is simply a matter of one command.
Best regards,
AJS
 
Replies continue below

Recommended for you

In general, elements can be chopped by setting them to []. For example:

A(3:5)=[]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor