Borrar filtros
Borrar filtros

Matrix manipulation Specific rows and columns

4 visualizaciones (últimos 30 días)
Brady Wayne Robinson
Brady Wayne Robinson el 27 de Sept. de 2018
Respondida: Jos (10584) el 27 de Sept. de 2018
I have a huge set of data in an excel spread sheet it is 16 columns A-P and 4800 rows.I need to take the data from column F and H and find where each of them is greater than 10 in the same row. and then sore this information in a variable.
So say I have the 16 columns, I want the 6th column and the 8th column. Once I call those out, I want to find where they each are greater than 10. Once I know where they are greater 10, I need to know where both are greater then ten in the same row. Like row 2000 column F and column H are greater then ten. Once I have the total number that is greater then ten in the same row I then will store them in a variable. Thank You so much.

Respuestas (1)

Jos (10584)
Jos (10584) el 27 de Sept. de 2018
First you need to read in the excel into a regular matlab array. Then use logical indexing to select your data. An example:
DATA = randi(10,10,8) % a small example
tf = DATA(:,3)>5 & DATA(:,6)>5 % where are the values in column 3 and 6 larger than 5
OUT = DATA(tf,[3 6]) % select those values from these columns

Categorías

Más información sobre Data Import from MATLAB en Help Center y File Exchange.

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by