how to use if else statement
Mostrar comentarios más antiguos
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.
2 comentarios
Dyuman Joshi
el 2 de Ag. de 2023
"how to use if else statement"
Cside
el 3 de Ag. de 2023
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Categorical Arrays en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!