Finding Rest of Row

5 visualizaciones (últimos 30 días)
Anjali Parmar
Anjali Parmar el 19 de Feb. de 2020
Comentada: Anjali Parmar el 19 de Feb. de 2020
Hello! Matlab newbie here. So I have a bunch of data in rows/columns. If I have a variable assigned to something in a specific row in column 1, how do I find the values in the rest of the row in the rest of the columns (there's like five total)? I appreciate any help!

Respuesta aceptada

Gifari Zulkarnaen
Gifari Zulkarnaen el 19 de Feb. de 2020
Do you mean like vlookup in excel? Try this:
data = randi(1,4,5); % Just an example matrix
first = data(randi(4),1); % Example of desired number in first column
index = data(:,1) == first; % Find in which row is your desired number located
rest = data(index,2:end); % Get the rest of columns of that row
  1 comentario
Anjali Parmar
Anjali Parmar el 19 de Feb. de 2020
Oh I see! Thank you!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by