Matlab test existence of file(fail)

0

I try to execute this 2 commands but the result is very weird

K>> delete lista_arqs.txt

Warning: File 'lista_arqs.txt' not found.

K>> exist('lista_arqs.txt','file')

ans =

 2

I mean..... I tried to delete a file and matlab told me that the file dont exist, ok. But later I tried to check for file existence and matlab told me that exist. At windows explorer the file don`t exist.

Some idea about this issue? My matlab 7.10.0.499 64-bit win7

Regards,

Rodrigo PG

Posted 2015-02-27T14:03:50.437

Reputation: 11

Answers

0

This may happen when the file you are trying to delete is in the matlab path not in the current directory. Try providing the full path for the file in the delete command. Also it is better to use

delete('filename')

instead of

delete filename

UditG

Posted 2015-02-27T14:03:50.437

Reputation: 17