Using zip('test', 'data.txt') Cannot open file "data.txt" for reading

Hi,
Just recently ugraded from Matlab 2018 to 2022 togehter with change to new computer. I have a GUI that zip several data files, like data..txt and .mat with test parameter and measureing data. I can't get the zip function working again. I have even tried just do a simple text file with numeric values but when I run zip('test', 'data.txt') I get "Cannot open file "data.txt" for reading, In zip (line 75)"
zip.m line 75: archive = matlab.io.internal.archive.core.builtin.createArchive(zipFilename,{entries.file},{entries.entry},mfilename);
I have no clue what is happening, does any of you out there explain what could be the reason?
Things I have tried:
Changed regional setting sicne we in nordic contries use , instead of . as decimal

 Respuesta aceptada

Vilém Frynta
Vilém Frynta el 2 de Mayo de 2023
Hi, just an idea: since you are using a new computer, there may be a possibility that you do not have accurately described path for your files, or you do not have the permissions? Have you tried running Matlab as an administrator?

5 comentarios

Thanks a lot your your replay. runt computer as Adm was a great idea and I have tried now, but same issue still.
The paths is alos something I suspceted, but it saves and load files correct expecpt that the zip functions is not working as I want.
I am 50/50 that is it some kind of computer setting or matlab is miss intrpretating the file it tries to read and zip. I have tried as method also just doing a simple .txt file with 1 2 3 in the cd but it still fails.
If any other ideas plz reach out and thanks!
Have you tried this on a different file? Not .txt but .csv or .xlsx etc.?
Thanks and I tried. I was thinking more what you mentioned run as Adm. It worked for a while but stopped workning, which made thinking about about the path. SO I copied all from domument folder (that is synced and regulary backed up) direclty to C\ instead and it worked.
Thanks a lot!
Glad I could assist with resolving your issue! I'd be happy if you could formally accept my answer. Thank you.

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Versión

R2022a

Etiquetas

Preguntada:

el 2 de Mayo de 2023

Comentada:

el 4 de Mayo de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by