Your advice is needed to help figure out an eloquent solution to compare two cell arrays (that contain strings). The first cell array (files) needs to be shrunk down whenever it exists in the second array (finishedfiles). The final shrunken down array is called newfiles. Is there a better way to do this???
count2= 0;
for i = 1:numel(files)
count = 0;
for j = 1:numel(finishedfiles)
if strcmp(files{i},finishedfiles{j})
count=1;
break;
end
end
if count == 0;
count2 = count2+1;
newfiles{count2} = files{i};
end
end
help intersect
not 100% sure, but i think this should do what you want
clc
clear all
files={'file1';'file2';'file3'};
finishedfiles={'file3';'file2'};
a=repmat(files,size(finishedfiles));
b=sort(repmat(finishedfiles,size(files)));
c=(strcmp(a,b));
d=reshape(c,size(files,1),size(c,1)/size(files,1));
newfiles=files(~logical(sum(d,2)))
Roland
files = setdiff(files,finishedfiles);
good times :)
TideMan <mul...@gmail.com> wrote in message <0da82bc4-f051-44cf...@x18g2000pro.googlegroups.com>...