function that does not work

Why does not this function work:
this is what i wrote:
function grade=onlyundefined(quiz)
if quiz<0 ||quiz>10
grade='X'
end
end

 Respuesta aceptada

Walter Roberson
Walter Roberson el 15 de Oct. de 2011

0 votos

You stored the function in the file "switchletgrade1.m" . The name of the file needs to match the name of the function.
Also, you will need to define the output for the situation when the "if" does not hold true.

Más respuestas (0)

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by