How to extract sub matrix from the main matrix?

4 vues (au cours des 30 derniers jours)
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD le 8 Mar 2019
Commenté : MAHMOUD ALZIOUD le 12 Mar 2019
Dear All, I have a numerical matrix of three columns, (Year, Month and Day), but each days does not have the same number of rows as another day, how can I tell MATLAB please to extract a matrix from the main one based on the 2nd & 3rd column value? for example I attached the file, what is the code to extract the matrix from 1/1/2010 to 2/3/2010? please see the excel file
  2 commentaires
Andrei Bobrov
Andrei Bobrov le 8 Mar 2019
Question.xlsx - empty file.
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD le 8 Mar 2019
here it is

Connectez-vous pour commenter.

Réponses (1)

KALYAN ACHARJYA
KALYAN ACHARJYA le 9 Mar 2019
Modifié(e) : madhan ravi le 9 Mar 2019
What I have found that there is no data as 2/3/2010.
Suppose I take as example your exel file having
Row 1: 10 1 1
...
..
Row 46: 10 2 4
Supose you want access the some portion of the excel file (2,2) to (10,3)-Submatrix includes the elements having inbetween,
it goes this way
filename='Question.xlsx';
data=xlsread(filename);
Data=data(2:10,2:3)
Output:
Data =
1 1
1 1
1 1
1 1
1 1
1 2
1 2
1 2
1 2
  1 commentaire
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD le 12 Mar 2019
this can be done if i have small datab but actully i have 1.2 million rows of data and i cannot do this manually

Connectez-vous pour commenter.

Catégories

En savoir plus sur Resizing and Reshaping Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by