function that does not work

1 次查看(过去 30 天)
Why does not this function work:
this is what i wrote:
function grade=onlyundefined(quiz)
if quiz<0 ||quiz>10
grade='X'
end
end

采纳的回答

Walter Roberson
Walter Roberson 2011-10-15
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Workspace Variables and MAT-Files 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by