how to match the dimensions of two columns in a table
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
MAHMOUD ALZIOUD
am 3 Apr. 2018
Kommentiert: MAHMOUD ALZIOUD
am 3 Apr. 2018
Dear all, I am truing to build a table with 2 columns in MATLAB, the 1st column is the month (from 1 to 12), the second column is the day in this month (from 1 to 30), so each cell in the month column will correspond to 30 cells in the day column, MATLAB does not do that because the dimension of the 2 column must be the same, how can I please repeat the number 1 in month 3o times?
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 3 Apr. 2018
YourTable = cell2table( [num2cell(1:12).', repmat({(1:30).'}, 12, 1)], 'VariableNames', {'Month', 'Days'});
Weitere Antworten (0)
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!