how can I open the folder from desktop using matlab code?
조회 수: 12 (최근 30일)
이전 댓글 표시
I am doing a project in that i have to open the folder using Matlab code. how can I open the folder from desktop using matlab code?
댓글 수: 1
Jan
2013년 9월 30일
It depends on what "open" and "the folder from desktop" exactly means here. Both terms could mean a variety of different things, so please add more information by appending it to the original question by editing. I've seen too many important information hidden in comments or pseudo-answers, where the readers do not expect it.
답변 (3개)
Image Analyst
2013년 9월 30일
편집: Image Analyst
2013년 9월 30일
If you're using windows, you can do
winopen(folderName);
where folderName is a string, for example 'D:\MyData'. It will bring up Windows Explorer open to the folder that you specified.
댓글 수: 0
Ryan Chester
2018년 1월 12일
This will give you the path to the desktop folder, and open it so you can select a file from it.
desktop=winqueryreg('HKEY_CURRENT_USER', 'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders', 'Desktop');
[FileName,PathName,FilterIndex] = uigetfile({'*'},'Here, the desktop is "open"',desktop);
댓글 수: 0
Simon
2013년 9월 30일
Hi!
You get the users directory in Windows with
[~, userdir] = system('echo %USERPROFILE%')
The desktop folder is in this folder.
댓글 수: 0
참고 항목
카테고리
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!