xlsread with sheet selection and xlRange
古いコメントを表示
I am using xlsread as such:
subset = xlsread(filename, sheet, xlRange)
In particular:
filename = 'nameF';
sheet = 'sheet1';
xlRange = 'A1'; % I use one column to cover or using sheet and xlRange together
subsetA = xlsread(filename, sheet, xlRange)
I get this:
subsetA =
[]
Same result when I use xlRange = 'A1:B1'
The purpose is to select particular columns from that sheetX of WorkbookY. Any recommendation?
Thank you
Eleftheria
採用された回答
その他の回答 (1 件)
Riffat Mughal
2021 年 12 月 31 日
0 投票
Hi,
I wanted to import data using xlsread command from each sheet (There are 750 sheets). In range I wanted to import data from selected columns let's suppose from E to M. In each sheet number of rows are different.
Can you please assist me how I can import data from each row using xlsread command.
4 件のコメント
Walter Roberson
2021 年 12 月 31 日
Is there a reason you have not switched to readtable() or readmatrix()?
Riffat Mughal
2021 年 12 月 31 日
Yes, because I'm working on Treasury bonds for which dates are important. Extracting data using readtable command is creating problem with the date variables.
Walter Roberson
2021 年 12 月 31 日
Which MATLAB release are you using? readtable does a pretty good job on dates as datetime objects. Sometimes you need to setvaropts to set input format though. Can you attach about 3 rows from one of the tables for testing?
Riffat Mughal
2021 年 12 月 31 日
Please find attached the requested file.
カテゴリ
ヘルプ センター および File Exchange で Tables についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!