extract specific points from a matrix of planar coordinates
2 次查看(过去 30 天)
显示 更早的评论
I have a 600x2 matrix with a series of planar points: x values on first column and y values on second one. How can I extract only the x values for which the corresponding y is null? Thank you!
1 个评论
John Chilleri
2017-5-1
编辑:John Chilleri
2017-5-1
What type of variable is your matrix (i.e. cell)? Or if it's a normal matrix, how do you define null?
回答(2 个)
KSSV
2017-5-1
Let A be your 600*2 matrix.
x = A(:,1) ;
y = A(:,2) ;
iwant = x(y==0) ; % respective _x_ for which y=0
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!