how to access a particular format files from a drive location?

조회 수: 5 (최근 30일)
sandy
sandy 2013년 8월 28일
hi.. In my D drive,many folders(app. 50 folders) are there.each having many formats of files.i need to access .zip files alone in each of the folders and move to separate folder..i am stuck here..

답변 (2개)

David Sanchez
David Sanchez 2013년 8월 28일
The following will return a struct containing the .zip files in the folder specified by path_to_zip_files:
my_zips = dir('path_to_zip_files\*.zip')
Then,
for k=1:numel(my_zips)
my_zips(k).name
end
returns the names of the .zip files recursively. Adapt the code to your needs.
  댓글 수: 1
sandy
sandy 2013년 8월 28일
this code showing only .zip files in Desktop alone.but many .zip files are there in locations( \test),(\Users) ...i need to access all .zip files in C DRIVE fully,not in particular path,
my_zips = dir('C:\Users\test\Desktop\*.zip');
for k=1:numel(my_zips)
my_zips(k).name
end

댓글을 달려면 로그인하십시오.


David Sanchez
David Sanchez 2013년 8월 28일
편집: Walter Roberson 2013년 9월 4일
  댓글 수: 8
Walter Roberson
Walter Roberson 2013년 9월 4일
Please show the complete log of the compilation.
sandy
sandy 2013년 9월 5일
편집: sandy 2013년 9월 18일
>>
mex -setup
Please choose your compiler for building external interface (MEX) files:
Would you like mex to locate installed compilers [y]/n? y
Select a compiler: [1] Lcc-win32 C 2.4.1 in C:\PROGRA~1\MATLAB\R2010b\sys\lcc
[0] None
Compiler: 1
Please verify your choices:
Compiler: Lcc-win32 C 2.4.1 Location: C:\PROGRA~1\MATLAB\R2010b\sys\lcc
Are these correct [y]/n? y
Trying to update options file: C:\Users\test\AppData\Roaming\MathWorks\MATLAB\R2010b\mexopts.bat From template: C:\PROGRA~1\MATLAB\R2010b\bin\win32\mexopts\lccopts.bat
Done . . .
************************************************************************ Warning: The MATLAB C and Fortran API has changed to support MATLAB variables with more than 2^32-1 elements. In the near future you will be required to update your code to utilize the new API. You can find more information about this at: http://www.mathworks.com/support/solutions/en/data/1-5C27B9/?solution=1-5C27B9 Building with the -largeArrayDims option enables the new API. ************************************************************************

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by