Error using load? Unable to read file

2 vues (au cours des 30 derniers jours)
Hesham Ismail
Hesham Ismail le 14 Juil 2015
Commenté : Hesham Ismail le 14 Juil 2015
Hello,
I have a question about load file. for example load laserdata and laserdata file is not there is there a way to return 0? for no file exist rather than error? I tried exist function in matlab but no luck?
Any help will be great

Réponse acceptée

Ingrid
Ingrid le 14 Juil 2015
you could use a try - catch block
try
load laserdata
catch
% write whatever code you want to be executed if the laserdata cannot be loaded
end
  1 commentaire
Hesham Ismail
Hesham Ismail le 14 Juil 2015
Thanks, I test it out work nicely

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Software Development Tools dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by