Combining Vector in a matrix
古いコメントを表示
I want to create a matrix that has first row as month second as date and the third as day
So far I am successful in creating three vectors and now I want to merge them in a matrix
function A=Jume2015
month = repmat('June', 30, 1);
date=[1:30];
d = {'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'};
dy = (d(mod(0:29, 7) + 1));
They should be merged in manner that I should get an output like this
>> m(11,:)
ans =
'June' [11] 'Thu'
Please help me.
If there are some errors in English please avoid them as English is a second language for me
採用された回答
その他の回答 (1 件)
Walter Roberson
2015 年 5 月 26 日
function A=Jume2015
month = repmat('June', 30, 1);
date=[1:30];
d = {'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'};
dy = (d(mod(0:29, 7) + 1));
A = [cellstr(month),num2cell(date(:)),dy(:)];
1 件のコメント
ammar ansari
2015 年 5 月 26 日
編集済み: ammar ansari
2015 年 5 月 26 日
カテゴリ
ヘルプ センター および File Exchange で Platform and License についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!