Borrar filtros
Borrar filtros

how do I delete a file that Matlab wrote

6 visualizaciones (últimos 30 días)
Wis
Wis el 12 de Mayo de 2016
Respondida: Image Analyst el 12 de Mayo de 2016
If I save an RF circuit (RF Toolbox) with the 'write' method, I cannot subsequently delete that file in a script during the same Matlab session. I get "Warning: File not found or permission denied".
With no explicit close for the RF Toolbox output files, it seems I'm stuck. If I exit Matlab, the file becomes accessible (unlocked).
  1 comentario
dpb
dpb el 12 de Mayo de 2016
Don't have the toolbox, but from the description if that is really so, seems like an oversight that I'd say rises to the level of "bug".
Contact Support at www.mathworks.com and file bug report/request workaround if they can find one.

Iniciar sesión para comentar.

Respuestas (1)

Image Analyst
Image Analyst el 12 de Mayo de 2016
You probably forgot to close it. Use fclose(). Or fclose all.
I don't know what write method you're talking about. This is all I have
write
Write data to remote host over TCP/IP interface
Does not sound like that's what you're referring to. If you're using xlswrite, MATLAB 22015b and later keeps Excel open to your file, unlike prior versions, so trying to delete the workbook may not work since you can't delete a file that some process has open and locked. Some programs, perhaps Excel, will place a lock on the file, and some programs, like Notepad, don't. Perhaps fclose('all') may fix it - I don't know. If not, you'll have to use actxGetRunningServer() to get the handle to Excel then quit Excel
hExcel = actxGetRunningServer('Excel');
hExcel.Quit;
or something like that.

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by