Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski 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
Joined
Aug 23, 2006
Messages
1
Location
DE
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
 
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

Back
Top