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!

답변 (1개)

per isakson
per isakson 2012년 5월 28일

0 개 추천

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

카테고리

도움말 센터File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

질문:

2012년 5월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by