Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
issue with .mat files
조회 수: 2 (최근 30일)
이전 댓글 표시
hello everyone!
so my faculty provided datasheets with .mat extension and those have to included in python programming for running the program but those files are not opening on MAC air, so when i run the code it states no such file or directory exists.
what can i do it resolve this? can someone please help me out
thank you
댓글 수: 0
답변 (1개)
Sourabh Kondapaka
2020년 9월 2일
Hi,
As you already have the datasheets (with .mat extension) with you on your system. I think these files are located in a folder whose name has a space within it or in the complete path to these files there seems to be a folder(s) which has a space in its name.
If a folder’s name has a space in it, you will have to add ‘\’ (which is known as an escape character) before the space when trying to access it.
Lets assume the following folder structure:
My_Folder1 -> My_Folder2 -> My Folder3
My_Folder1 contains My_Folder2 and My_Folder2 contains ‘My Folder3’
And ‘My Folder3’ has your datasheets.
Notice that ‘My Folder3’ has a space in between ‘My’ and ‘Folder3’
Programmatically, you’ll have to reference the path in Linux or MacOS as follows:
path = 'My_Folder1/My_Folder2/My\ Folder3/datasheet1.mat';
If instead of the My_Folder1 the name was ‘My Folder1’
Then the path would look like:
path = ‘My\ Folder1/My_Folder2/My\ Folder3/datasheet1.mat’
As your files could be nested inside multiple folders which can have spaces in their names, you will have to add a ‘\’ before every space in the name of the folder.
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!