from .txt file to .mat file

2 visualizaciones (últimos 30 días)
ROBERTA NOCERINO
ROBERTA NOCERINO el 30 de Jun. de 2019
Respondida: Soumya Sinha el 1 de Jul. de 2019
Hi :)
I'm quite new in Matlab and I'm having trouble with a text file. I should import it and convert in a .mat file so that I will be able to load directly the mat file.
But when I use the importdata(filename) function an error appears that says that is unable to open the file and I don't know why
I hope you could help me to solve this problem
  3 comentarios
dpb
dpb el 30 de Jun. de 2019
Editada: dpb el 30 de Jun. de 2019
Well, being unable to open the file isn't the same as not being able to read the file.
Provide the actual error message text in context with the command you used...
>> importdata('junkdata.txt')
Error using importdata (line 137)
Unable to open file.
>>
If it is something like the above, it means the file doesn't exist or isn't in a location on MATLABPATH; use a fully-qualified filename to open an existing file in another location or, make sure the filename is correctly spelled, etc., etc., ... (*)
Uploading the file here isn't going to solve this kind of problem.
(*) Or, maybe don't have permissions or somesuch other things can also be issues...
Shameer Parmar
Shameer Parmar el 1 de Jul. de 2019
Editada: Shameer Parmar el 1 de Jul. de 2019
Hello Roberta,
Can you please provide .txt file or modified .txt file so that we can check for the error and resolve it..

Iniciar sesión para comentar.

Respuestas (1)

Soumya Sinha
Soumya Sinha el 1 de Jul. de 2019
Hi Roberta,
You can know more about importing a text file to matlab script by following the link Importing .txt files
It would be better if you would attach the file, so that I can tell the exact steps that you can reproduce at your end to get the desired result.

Categorías

Más información sobre Workspace Variables and MAT-Files en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by