2014 equivalent dir **\*.mat?

조회 수: 5 (최근 30일)
Chase Ward
Chase Ward 2018년 12월 12일
댓글: Image Analyst 2018년 12월 12일
Have created a gui in 2017b, after discovering that we have some, you could say, legacy simulations created in 2014b, I need to make it work with 2014b now. The dir **/*.mat function is was extremely helpful to me in first iteration. Despite being introduced in 2006a, it doesn't work as needed in 2014b.
Is it a syntax error possibly? Or was that functionality added later? Are other functions that could potentially provide me with the same functionality?
Many Thanks
  댓글 수: 3
Chase Ward
Chase Ward 2018년 12월 12일
In 2014b that seems to give a root directory of some sort.
Steven Lord
Steven Lord 2018년 12월 12일
Jan is correct. While the dir function has existed for a very long time, the capability to use ** to search folders and subdirectories recursively in the dir function was introduced in release R2016b.

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

답변 (2개)

Jan
Jan 2018년 12월 12일
You find many many functions for a recursive search in the file exchange: Search for "recursive dir":
  댓글 수: 1
Chase Ward
Chase Ward 2018년 12월 12일
This seems promising. Thank you.

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


Image Analyst
Image Analyst 2018년 12월 12일
See my attached demo to recursively search subfolders.
Also not sure why you don't just run the simulations in the modern version. Do they not work? If not, then why not fix them so they work with the latest version? Everytime I touch old code, I just bring it up to the latest version of MATLAB.
  댓글 수: 2
Chase Ward
Chase Ward 2018년 12월 12일
I honestly would love to do that. I have tried to bring the code up date, its mighty complex and I think some simulations rely on one another to an extent. Even with the upgrade tool. If I had built them, I imagine it could be done, but would likely take a significant amount of time ( think they were likely built with a team). I have called in to get help with this, but they found the project to be large and difficult as well.
It can run on newer versions of matlab. However, on 17b, it runs very slow (likely due to the needed upgrade).
Yes, its an awful predicament. Thanks for input.
Image Analyst
Image Analyst 2018년 12월 12일
I guess I don't know why you need to develop more code. If you download the old version and run the old software on the old MATLAB release, which used to work, then why does it not work any longer such that you need new directory traversing code?

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

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by