how can I delete a full row based on a if condition?
古いコメントを表示
for example if I have a matrix with call (1) and putoption (2) data and I would like to have only the calloption data. Iwas thinking maybe I could run a for condition and create a new matrix just using the call data, is that possible?
採用された回答
その他の回答 (3 件)
Locks
2013 年 3 月 10 日
編集済み: Walter Roberson
2013 年 3 月 10 日
If your data is stored in a 150000x7 matrix D, you can build D_call and D_put as follows:
D_call = D(D(:,3)==1,:) ;
D_put = D(D(:,3)==2,:) ;
Locks
2013 年 3 月 10 日
0 投票
3 件のコメント
Azzi Abdelmalek
2013 年 3 月 17 日
Sven, you have to accept the answer that helped you by clicking accept this answer
Jan
2013 年 3 月 18 日
@Sven: You do not have to accept an answer, but it would be helpful for the readers and for the author of the answer. So please take the time to accept an answer, such that this question is marked as "solved".
Cedric
2013 年 3 月 18 日
Thank you Azzi and Jan; I stopped making this kind of remarks, but I should have gone on. I appreciate that you took the time to do it!
カテゴリ
ヘルプ センター および File Exchange で Exploration and Visualization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!