select folder by its name?
조회 수: 3 (최근 30일)
이전 댓글 표시
Good Morning, I'd like to sort folders from a folder, let's say:
I have the folder "A" which contains folders:
1
2
3
4
5...
100
if I use
d = uigetdir('C:\A\number') %where number is the name of the folder,it works.
What about taking 'number' as a variable inside the "uigetdir"? Thanks, jahnludvik
댓글 수: 0
채택된 답변
Adam
2015년 2월 20일
편집: Adam
2015년 2월 20일
n = 10;
d = uigetdir( [ 'C:' filesep 'A' filesep num2str(n) ] )
should work. There are other ways to compose a filename from parts if you prefer, using the fullfile function, but it is equivalent so it's up to you.
fullfile( 'C:', 'A', num2str(n) );
would be the fullfile alternative.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Filename Construction에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!