Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Removing several cells from a vector

Subject: Removing several cells from a vector

From: Kian

Date: 12 May, 2013 20:55:08

Message: 1 of 2

Hi there,

I ve got very simple (!) problem:

I have: A = [1;2;3;4;5;6;7;8;9]
and I want to get A = [1;2;4;5;7;8]
i.e. I want to delete the 3rd, 6th, and 9th elements from my vector.

Tried many ways, no success.

I will appreciate your help.

Subject: Removing several cells from a vector

From: Yehonatan

Date: 13 May, 2013 03:38:08

Message: 2 of 2

There were a couple of threads on this topic.
I have found them when i needed them.
anyway, the method used when deleting a cell in a matrix is this:

A = [1,2,3,4,5,6,7,8,9]
A =

     1 2 3 4 5 6 7 8 9

A(:,[3,6,9]) = []

A =

     1 2 4 5 7 8

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us