rejection method

Hey all,
i created a 2xn matrix where the first row indicates time uniformly distributed... However i want to delete from the matrix columnwise if in the first row the time takes the value 0. i tried to do this using an if algorithm however it seems to reject all values and i end up with an empty matrix. does anybody know how to fix this?
Thanks for your help!

Respuestas (1)

per isakson
per isakson el 28 de Mayo de 2012

0 votos

Firstly, it would probably be more efficient to use a .<nx2> matrix. Matlab is column oriented.
Try
M( :, M(:,1)==0 ) =[];

Categorías

Más información sobre Mathematics en Centro de ayuda y File Exchange.

Preguntada:

el 28 de Mayo de 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by