필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

issue with .mat files

조회 수: 1 (최근 30일)
rishikha numburi
rishikha numburi 2020년 8월 26일
마감: MATLAB Answer Bot 2021년 8월 20일
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

답변 (1개)

Sourabh Kondapaka
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.

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by