how to write a function to return -1 if string is not found in matlab??

I wrote a function that finds a 3 digit number of a filename? i need to write an if statement to return -1 if this part of the file cannot be extracted ? how do i do that?
Thanks :)

2 comentarios

There are several possible ways to do this. Can you post your code, or at least the part of it that attempts the extraction?
ANY 3 digit number whatsoever, or only a specific 3 digit number that you specify in the input argument list along with the filename?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Variables en Centro de ayuda y File Exchange.

Preguntada:

el 5 de Sept. de 2016

Comentada:

el 6 de Sept. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by