Matlab Grader - Determining if a variable is a function handle.
6 views (last 30 days)
Justin Wyss-Gallifent on 15 Jun 2020
I'm writing a Matlab Grader assignment in which I'd like the students to define a function, say f, as a function handle. I'd then like an assessment test which verifies this. I figured an assessment test in Matlab code which simply said:
would do the job but this registers as true (in Matlab Grader) even when f is not a function handle.
Cris LaPierre on 15 Jun 2020
Edited: Cris LaPierre on 15 Jun 2020
Assessment tests must assert the result. They do not recognize logical results as answers to the test. So the issue is not that false is being marked as correct. The isa(f,'function_handle') is returning false. It is that no assert has told Grader the result is incorrect.
More Answers (0)
More Answers in the Distance Learning Community