How to create a cell with multiple entries in one line of code?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
ampaul
am 14 Jul. 2017
Beantwortet: Star Strider
am 14 Jul. 2017
Hi, I am trying to create a cell for a classification problem. The cell is 75x1. For every 25 entries down the rows, each has a specific classification: 'first', 'second', and 'third'. How can I create this in a line of code? This is what I have so far but I am receiving an error.
Group = cell(75,1,1:25,1,'first',26:50,1, 'second', 51:75,1, 'third')
Thank you
0 Kommentare
Akzeptierte Antwort
Star Strider
am 14 Jul. 2017
You can just use curly brackets ‘{}’ to create it as a cell array:
Group = {75,1,1:25,1,'first',26:50,1, 'second', 51:75,1, 'third'};
Is that the result you want?
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Classification 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!