Reading values corresponding to index

Hi,
I am reading an excel xlsx file in MATLAB. I am reading the index from the file but also want to read the value in a column corresponding to that index. For example I am reading the index value 89792 but also want to read and display the corresponding value in column D highlighted in yellow.

댓글 수: 8

Waqas Siddique
Waqas Siddique 2021년 2월 21일
Can I get some help on this?
Cris LaPierre
Cris LaPierre 2021년 2월 21일
Consider sharing the code you are using. You might also consider attaching your spreadsheet to your post using the paperclip icon. Those items are easier to work with than a screenshot.
Waqas Siddique
Waqas Siddique 2021년 2월 21일
I am using the command
Date_Time = T{89792,4}. however, this is retuning me a timestamp of 30 minutes more for each index. For example for the index shown 89792, it is returning 24.10.2013 18:05. How can i correct this?
the cyclist
the cyclist 2021년 2월 21일
I don't see how to help without your uploading the data and your code.
Waqas Siddique
Waqas Siddique 2021년 2월 21일
My data file is too large(more than 100MB).
I am reading the index from the file but also want to read the value in a column corresponding to that index. As shown in my screenshot I want to read the value corresponding to the index 89792 in column D which is the date and similarly for other index. I am using the command Date_Time = T{89792,4}. however, this is retuning me a timestamp of 30 minutes more for each index.
Ive J
Ive J 2021년 2월 21일
I mean people here are programmers/engineers/data scientists, but doubt if they know magic too. How is it possible to help you without having anything to work with?
Please share your scirpt you use to read your table; or mat file of your table.
Waqas Siddique
Waqas Siddique 2021년 2월 21일
Please I need guidance on this. I have attached another screen shot. I need to read the value(which is a date and time value) in column D corresponding to the specific index highlighted in yellow.
the cyclist
the cyclist 2021년 2월 21일
I am hopeful that @Walter Roberson's answer below will help you figure it out. It's a good guess at the problem.
If not, maybe you could create a smaller version of your data file that shows the problem? For example, perhaps you could upload just the first few hundred rows of the Excel file, and code that tries to access an element.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2021년 2월 21일

0 개 추천

Date_Time = T{89792,4}
is going to access row 89792 of the data table. That will not necessarily be the same as row 89792 of the .xlsx file. In particular, the rows that are considered to be headers will be skipped in the count.
If you cannot correct for that by subtracting the number of header lines from the indexing you use, then you should change from readtable() to readcell(), as readcell() will return all lines including headers.

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

질문:

2021년 2월 19일

댓글:

2021년 2월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by