Create a Matrix from a cell array
Ältere Kommentare anzeigen
Hello
I want to create a matrix from a cell with the below:
cell(1,1)='Value,Rooms,Cleanliness,Service' cell(1,2)='2 of 5 stars,2 of 5 stars,4 of 5 stars,2 of 5 stars' cell(2,1)='Value,Location,Sleep Quality,Rooms,Cleanliness,Service' cell(2,2)='5 of 5 stars,5 of 5 stars,5 of 5 stars,5 of 5 stars,5 of 5 stars,5 of 5 stars'
cell(3,1)='Location,Rooms,Cleanliness,Service' cell(3,2)='4 of 5 stars,1 of 5 stars,3 of 5 stars,4 of 5 stars'
etc
I want to combine each characteristic for example location with each rating for example in cell(2,2) is 5 in cell(3,2) is 4. This ratings should be at the same column. If the rating doesn't appear for example the location in the first raw the matrix will take the number 10.
Do you have any ideas?
Thank you.
1 Kommentar
Akzeptierte Antwort
Weitere Antworten (1)
Image Analyst
am 22 Sep. 2016
0 Stimmen
A 2-D cell array (like you have) is a matrix. It's a matrix of cells. Just define your cells differently if you want the things in between the commas to be in different cells.
1 Kommentar
Thimiod Athan
am 22 Sep. 2016
Bearbeitet: Thimiod Athan
am 22 Sep. 2016
Kategorien
Mehr zu Data Type Conversion finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
