Iteratively wants to change column while reading MS-Excel sheet

2 ビュー (過去 30 日間)
SYED AQEEL HAIDER
SYED AQEEL HAIDER 2018 年 9 月 11 日
編集済み: Dennis 2018 年 9 月 11 日
I am writing a code to read data from an excel sheet column-wise. The excel sheet is having 50 data columns. Each column has 50 data entries/rows. I want to read all 50 columns one by one using some loop. I know that 'xlsread' is to used but how to change the range of cells i.e 'A1:A50', 'B1:B50', ... so on for every new iteration of loop.

採用された回答

Dennis
Dennis 2018 年 9 月 11 日
編集済み: Dennis 2018 年 9 月 11 日
I recommend to use xlsread just once to retrieve all your data. They will already be stored in a neat cell structure ready to be processed. You can loop over the cell instead.
xlswrite('test.xls',randi(10,10,50)); %some random data
[~,~,raw]=xlsread('test.xls');
raw{:,5} %column 5 values

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import from MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by