Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

How can I get the row of a certain value in excel

1 visualización (últimos 30 días)
abich
abich el 12 de Jun. de 2017
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
I have an excel file of two sheets. In each sheet i have 2 columns, the first representing some IDs(corresponding to some tasks) and the second representing minutes, so all the values are of type integer. At first, i search for a redundant task ID in both sheets, then I look for the minutes corresponding to the task in both sheets and then i shall calculate the difference. So Here is the code I used
if true
firsttasks = xlsread('myfile1','Feuil1', 'A1:A3');
secondtasks = xlsread('myfile1', 'Feuil2', 'A1:A3');
Lia = ismember(firsttasks,secondtasks,'rows');
for i=1:3
if Lia(i) == 1
found = firsttasks(i);
%get the minutes for the redundant task 'found', in sheet 1
minute1 = raw(i,i);
end
end
end
At this point, i have extracted the redundant task and the minutes corresponding to it in the first sheet. Now i need to extract the minutes from the second sheet, corresponding to the same task ID.
I am relatively new to Matlab, so im sure there's an even better way to do all this. Thanks in advance for your help.

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by