how to use if else statement
Mostra commenti meno recenti
Hello,
I have a list of participants (A, B, C, D...) and would like to extract their data from the dataset X. This dataset has numerous missing data. As there are multiple rows for the same participant, I would like to
- to filter all the rows containing specified participant
- have an if else statement - if column 4 contains a 'Yes', to insert column 5 'Male' into an array Y. else if column 4 is 'No', to insert column 7 'Female' into the same array Y
- ideally, the output should look like a 4x2 array with each unique participant matched to their gender
A Male
B Male
C Female
D Female
I have attached the sample data here.
Thank you very much for your help.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Categorical Arrays in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!