extract specific points from a matrix of planar coordinates
1 回表示 (過去 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!