HowTo 'IFError' and skip
    15 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
How do identify an error in order that I can skip and run alternative script.
I want to
    if fprintf('\t%s\n',TPin{1,2}{:}) iserror("??? Cell contents reference from a non-cell array object.")
do A;
else
do B;
90% of the time no error will occur, so would I be better writing;
do fprintf('\t%s\n',TPin{1,2}{:});
iserror goto do alternative;
In any case how do I pick up the error and perform a switch in task.
0 comentarios
Respuesta aceptada
  the cyclist
      
      
 el 2 de Dic. de 2011
        You want to use a "try ... catch" construct:
   >> doc try
3 comentarios
Más respuestas (0)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

