Accessing network drives from within Matlab

조회 수: 42 (최근 30일)
Matt J
Matt J 2024년 9월 10일
댓글: Matt J 2024년 11월 15일
I have two Windows 10 computers running Matlab 2023b on the same network. On one computer, I am able to reach a remote network drive easily enough from the Matlab prompt,
>> cd '\\drivepathname'
However, on the other computer, while I can access the network drive through Windows File Explorer, I cannot do so from within Matlab,
>> cd '\\drivepathname'
Error using cd
Unable to change current folder to '\\drivepathname' (Folder access failure).
I am trying to guess what might be different about the 2 installations. Ay suggestions are welcome.
EDIT: If it matters, the computer which is throwing the error is accessing the network via a VPN.
  댓글 수: 5
Michelle
Michelle 2024년 11월 15일
May be it is a problem with access rights? Try to start matlab as admin.
Matt J
Matt J 2024년 11월 15일
So I have now discovered the problem occurs only when running as admin. I don't know what that might indicate.

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

답변 (1개)

Swastik Sarkar
Swastik Sarkar 2024년 9월 17일
Assuming the SMB port is open on the system with the shared folder and a VPN is being used to access these folders, here are two common methods to consider:
1. Map Network Drive: Map the address of the network shared folder to a drive letter on the PC, such as Z:. Then, use the following MATLAB code:
cd("Z:")
You can learn more about mapping a network drive here:
2. Use the IP Address: Access the shared folder using its IP address. For example, to access the shared directory, use the following MATLAB code:
cd("\\IP_ADDRESS\Path\To\Folder") % Example: cd("172.0.0.2\Users")
I hope this helps you.
  댓글 수: 3
dpb
dpb 2024년 9월 17일
Check UAC settings on the two machines..
Swastik Sarkar
Swastik Sarkar 2024년 9월 19일
From some reason, the Example did not get formatted correctly, please try the below line of code:
cd("\\172.0.0.2\Users") % Replace IP Address and Folder Path

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

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by