How to delete rows of a matrix when one column contains a dummy variable
Show older comments
I need to resize my data sample. I have a data matrix that looks like:
Data = [lnwages educ exp expsq black married]
Each column of Data is a 13,000 x 1 vector. Hence data is a 13,000 x 6 matrix. Educ, black, married are dummy variables (0's or 1's).
How can I delete all the rows where married = 1? This would change my data so that it only contains unmarried individuals and their corresponding wages, educ, etc.. Married is the sixth column of data.
I would like the output in a new matrix. Call it newdata.
Thanks so much for your help.
Accepted Answer
More Answers (0)
Categories
Find more on Data Exploration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!