How to Manipulate Values in the Table
Mostrar comentarios más antiguos
Edits: excel sheet and .m file have been attached!
Hello, I have a dataset in excel which I have imported in a MATLAB table. I want to do some manipulations of the values in the table to create a new table in a desired format. As you can see in the photo attached, what I originally have is on the left, and the desired table is on the right. In the raw table, I have some values such as "B", "ADI", "FCBGE" in column C ("Cat_A").
For each row, I want to insert "1" or "0" from Column C to Column I based on the value in Column C. For example, the value in cell C2 C is "B", then I want to fill cell D2 ("Cat_B") with "1". Since there's no other letters in cell C2, cell C2, D2,E2,F2,G2,H2,I2 should be filled with "0". By applying this rule to each row, I have a new table on the right (in the photo).
I'd appreciate if someone can give me some tips to do the manipulations.

2 comentarios
Image Analyst
el 7 de Jul. de 2016
It would be easier for people to try things if you attached your data in a .mat file.
Shuyuan Liu
el 7 de Jul. de 2016
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Spreadsheets en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!