Hi Devendra,
I understand that you want to know why you are unable to get the desired result from the given code snippet.
This is because of the usage of 'ismember' function with wildcards ('*'). The 'ismember' function checks for exact matches from the provided list of names, and it does not interpret the wildcard ('*') as 'any characters'.
To achieve the functionality you're looking for, you can use regular expressions to identify files that match your pattern. For this, you can use 'regexp' function. The given code shows how to use it:
filename = files(i + j).name;
% Regular expression to match the filenames
pattern = 'T43RGN_.*_(B03|B04|B08)_10m.jp2';
if ~isempty(regexp(filename, pattern, 'once'))
img = imresize(img, 0.5, 'Method', 'bilinear');
end
You can learn more about the 'regexp' function from the below documentation:
Hope this helps!