Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

issue with .mat files

1 visualización (últimos 30 días)
rishikha numburi
rishikha numburi el 26 de Ag. de 2020
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
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

Respuestas (1)

Sourabh Kondapaka
Sourabh Kondapaka el 2 de Sept. de 2020
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.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by