フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How to organize similarly named files: Round 2

1 回表示 (過去 30 日間)
Frank
Frank 2011 年 5 月 20 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hello!
Got kinda lost, I'm not sure once again. So far I've written the script that tells MatLab to read all the images I have in a folder, but I'm not quite sure how to make it recognize the small differences in the file name and move it into a specified folder.
Thanks
-Frank
Code:
%Splits CH1 in the same folder with CH2
fprintf('Select Directory \n')
A = uigetdir();
cd(A)
mkdir('Channel 1')
mkdir('Channel 2')
myFolder = uigetdir();
filePattern = fullfile(myFolder, '*.tif');
tifFiles = dir(filePattern);
for k = 1:length(tifFiles)
baseFileName = tifFiles(k).name;
fullFileName = fullfile(myFolder, baseFileName);
fprintf(1, 'Now reading %s\n', fullFileName);
imageArray = imread(fullFileName);
for m = 1:length(tifFiles)
n = dir *LineScan-2010_12_08-005_Cycle001_CurrentSettings_Ch1_*.tif
movefile(n , 'C:\Users\xuf\Desktop\LineScan-
2010_12_08-005\Target\Channel 1')
end
movefile('*.tif', 'C:\Users\xuf\Desktop\LineScan-2010_12_08-005\Target\Channel 2')
imshow(imageArray);
drawnow;
end
  1 件のコメント
Andy
Andy 2011 年 5 月 20 日
First, it is generally recommended that you not accept an answer until you are fully satisfied with it. Second, it is also generally recommended that you don't duplicate your questions. You could have instead added this comment to your previous question without duplicating.

回答 (0 件)

この質問は閉じられています。

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by