How to create a double array from a cell array
20 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Asim Shahzad
am 7 Feb. 2021
Beantwortet: Walter Roberson
am 13 Feb. 2021
I want to convert this data into the image shown after
paths = ["path1";"path2";"path3"];
cellData = {1,2,3,4;5,6,7,8;9,10,11,12};
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/518242/image.jpeg)
How do I do this?
4 Kommentare
Siddharth Bhutiya
am 8 Feb. 2021
Do all rows have the same number of columns in your cell array data ?
Akzeptierte Antwort
Walter Roberson
am 13 Feb. 2021
paths = ["path1";"path2";"path3"];
cellData = {1,2,3,4;5,6,7,8;9,10,11,12};
imageFilename = paths;
vehicle = cell2mat(cellData);
table(paths, vehicle)
If you are going to put more than one group into the vehicle area, then instead
paths = ["path1";"path2";"path3"];
cellData = {1,2,3,4;5,6,7,8;9,10,11,12};
imageFilename = paths;
vehicle = num2cell(cell2mat(cellData),2);
table(paths, vehicle)
you will not be able to get the actual numbers to display in that situation
0 Kommentare
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!