フィルターのクリア

how to match the dimensions of two columns in a table

3 ビュー (過去 30 日間)
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD 2018 年 4 月 3 日
コメント済み: MAHMOUD ALZIOUD 2018 年 4 月 3 日
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?

採用された回答

Walter Roberson
Walter Roberson 2018 年 4 月 3 日
YourTable = cell2table( [num2cell(1:12).', repmat({(1:30).'}, 12, 1)], 'VariableNames', {'Month', 'Days'});
  1 件のコメント
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD 2018 年 4 月 3 日
THANK YOU MR WALTER, THIS WORKED WELL

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by