how can I delete a full row based on a if condition?
1 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
采纳的回答
Walter Roberson
2013-3-10
Yes, that is one option. Another is (e.g.)
idx = (profit < 0);
funds(idx,:) = [];
更多回答(3 个)
Locks
2013-3-10
3 个评论
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!
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Price and Analyze Financial Instruments 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!