How to transpose multiple rows into one column?

12 ビュー (過去 30 日間)
Jürgen Duchenne
Jürgen Duchenne 2020 年 5 月 5 日
編集済み: Surafel 2022 年 9 月 3 日
Dear all,
I have an Excel sheet with a data matrix. It's nummeric data; 18 columns wide, each 200 rows long. I would like Matlab to read the Excel file, and to transpose each of the rows below the previous one, in one single column. The end result should be 1 column with 3600 rows. It would be great if Matlab would save this column in a new txt or csv file.
Matlab info: I am using Matlab R2017b
Thanks for your help,
Jürgen

回答 (2 件)

KSSV
KSSV 2020 年 5 月 5 日
num = xlsread(myfile) ;
data = num(:) ;
Read about fprintf, save, dlmwrite, to write the data into your required file.

Surafel
Surafel 2022 年 9 月 3 日
編集済み: Surafel 2022 年 9 月 3 日
num = xlsread(Your file Location) ;
Transpose = num'
data = Transpose(:) ;

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by