how to refer an element in a column to related a value in another cloumn?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
I have a data set as attached. 6th column represent the time. I want to find the value in the 2nd Column related to "GX" in 1st column at the time "11:49:29 " I appreciate if anyone can suggest a method for this?
Thanks in advance.
0 Commenti
Risposte (1)
JESUS DAVID ARIZA ROYETH
il 7 Nov 2016
fileID = fopen('text.txt');
C = textscan(fileID,'%s %s %s %s %s %s %s','Delimiter',',');
fclose(fileID);
C=[C{:}];
value=C{and(strcmp(C(:,1),'GX'),cell2mat(cellfun(@(x) ~isempty(strfind(x,'11-49-29')),C(:,6),'UniformOutput', false))),2};
disp(value)
1 Commento
Vedere anche
Categorie
Scopri di più su Matrix Indexing in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!