how to refer an element in a column to related a value in another cloumn?
1 view (last 30 days)
Show older comments
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 Comments
Answers (1)
JESUS DAVID ARIZA ROYETH
on 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 Comment
See Also
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!