How do I remove all filenames from my cellarray with .m ending, if else how do I save those with .bmp?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have saved all filenames in a cell array for a given folder however, I only want it to include the files with ending .bmp.
function filer = filnamn(katalog)
%Ger en cell med de filer som finns i sökta katalog.
filer = dir(katalog);
filer = {filer(~[filer.isdir]).name};
end
How would I go about doing this?
댓글 수: 2
Stephen23
2021년 2월 26일
"How do I remove all filenames from my cellarray with .m ending, if else how do I save those with .bmp?"
Note that in general code files and data files should be stored separately. Keeping data files off the Search Path will improve MATLAB efficiency when changing directories or adding files.
채택된 답변
참고 항목
카테고리
Help Center 및 File Exchange에서 File Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!