MATLAB: Compare multiple columns in a cell array with strcmp

strcmp

I have an m x n cell array. I would like to pull specific rows that match strings from different columns. Currently, I'm accomplishing this with two matlab lines as follows:
hill_log = runlog1(strcmp(runlog1(:,4), 'Hill'),:);
hill_log2 = hill_log(strcmp(hill_log(:,6), 'Kilometer'),:):
I'd like to be able to do this on one line with one strcmp, possible?
Thanks Dave

Best Answer

Hum, why not use logical operations?
hill_log2 = runlog1(strcmp(runlog1(:,4), 'Hill') & strcmp(hill_log(:,6), 'Kilometer'), :);
In my opinion, it expresses the intent better than concatenating strings with a special character.