Got Questions? Get Answers.
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:
deleting element in matrix

Subject: deleting element in matrix

From: ike

Date: 23 May, 2012 07:23:08

Message: 1 of 2

i have a matrix

83 132
111 139
119 144
127 150
133 158
142 175
144 184
145 194
55 249

if the second column of that marix is larger than 200, i want to remove that element from matrix, so the matrix will become

83 132
111 139
119 144
127 150
133 158
142 175
144 184
145 194

how to do it ?
help me with the code please
thanks

Subject: deleting element in matrix

From: Nasser M. Abbasi

Date: 23 May, 2012 07:29:48

Message: 2 of 2

On 5/23/2012 2:23 AM, ike wrote:
> i have a matrix
>
> 83 132
> 111 139
> 119 144
> 127 150
> 133 158
> 142 175
> 144 184
> 145 194
> 55 249
>
> if the second column of that marix is larger than 200, i want to remove that element from matrix, so the matrix will become
>
> 83 132
> 111 139
> 119 144
> 127 150
> 133 158
> 142 175
> 144 184
> 145 194
>
> how to do it ?
> help me with the code please
> thanks


A(A(:,2)>200,:)=[]


--Nasser

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