moonnightingale
Full Member level 6
Kindly explain me these 2 lines of code
for i=1:size(S,1) % i loop continues till it gets size of row of matrix S
[tf, loc] = ismember(S(i,: ),SEP,'rows'); % WHAT IS FUNCTION OF LOC
D(i,: ) = EP(loc,: ); % KINDLY EXPLAIN THESE TWO LINES
end
I know ismember compares each row of matrix S with each row of SEP and returns 0 if they are not same and 1 if they are same. But what is function of tf and LOC there
for i=1:size(S,1) % i loop continues till it gets size of row of matrix S
[tf, loc] = ismember(S(i,: ),SEP,'rows'); % WHAT IS FUNCTION OF LOC
D(i,: ) = EP(loc,: ); % KINDLY EXPLAIN THESE TWO LINES
end
I know ismember compares each row of matrix S with each row of SEP and returns 0 if they are not same and 1 if they are same. But what is function of tf and LOC there