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