Comparing strings in two different tables with eachother
Show older comments
I'm helping a friend out with a script, but I can't say that I know it all due to the data, which she has, is in a table. She is getting two different tables, and the first column will contain different strings showing day/month/year hour/minute/second. She wants a script that can check if some of the time data are the exact same in the two tables, and if they are, the row in the second table will be imported into some extra columns added in the end of the first table.
I personally have it all in my head on how it should be working, but the fact that the data is in a table, and probably also because it's strings, makes it hard for me to get this to work as I wanted. Right now I'm just testing if the script can find a certain date and time with the following code, but it doesn't seem to find it.
H = height(data_table);
for i = 1:H;
if strcmp('07/04/17 02:55:00',data_table(i,1)) == 1
fprintf('Found! \n')
else
fprintf('Nothing! \n')
end
end
It should find the date and time, but it doesn't seem to print anything else than 'Nothing!'
Accepted Answer
More Answers (0)
Categories
Find more on Data Import from MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!