How to select and write values from data into excel

I have a single column of 98820 values i want to divide them into groups of 4941 and write them in separate columns in excel

 採用された回答

Jan
Jan 2017 年 2 月 23 日

1 投票

x = rand(98820, 1);
y = reshape(x, 4941, 20);
xlswrite(FileName, y);

3 件のコメント

John BG
John BG 2017 年 2 月 25 日
what if 98829/4941 is not integer? then this doesn't work.
Image Analyst
Image Analyst 2017 年 2 月 25 日
Correct (though this more general question wasn't asked). If the vector is not an integer multiple of the number in a group, then Arslan should choose a different group size or else re-think what he wants to do. For the stated numbers, this works.
Arslan F
Arslan F 2017 年 2 月 26 日
98820/4941 is an integer its 20 (its not 98829)

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeData Import from MATLAB についてさらに検索

質問済み:

2017 年 2 月 23 日

コメント済み:

2017 年 2 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by