How to extract the certain range of values from array?

8 vues (au cours des 30 derniers jours)
Yanjika O
Yanjika O le 17 Mai 2020
Modifié(e) : Yanjika O le 18 Mai 2020
Hello, I have imported two column of data from excel which also had several other columns as follows:
T=readtable('safe_1.xlsx','Sheet','safe_1','Range','H1:H23026');
t=table2array(T)';
And now I would like to have certain range of data from the imported columns. However, I could apply this when I import the data from excel, it is very time consuming when I come to repeat it 10 times in order to extract 10 ranges of data from the column.
So, I wonder is there any other way to achieve this like binning?
  1 commentaire
madhan ravi
madhan ravi le 17 Mai 2020
Modifié(e) : madhan ravi le 17 Mai 2020
Upload your file.

Connectez-vous pour commenter.

Réponse acceptée

Image Analyst
Image Analyst le 17 Mai 2020
% Extract rows from t if value in column1 is between value1 and value2
rows = t{:, 1} > value1 & t{:, 1} < value2;
t2 = t(rows, :)
  1 commentaire
Yanjika O
Yanjika O le 18 Mai 2020
Modifié(e) : Yanjika O le 18 Mai 2020
Thank you!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Data Import from MATLAB dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by