Why the assessment shows the keyword not presented however it is in the code in the MATLAB grader?

1 view (last 30 days)
In MATLAB Grader, I set up the reference solution, added two assessment, one to check the keywords' presence and the other check the results. Then I run the same answer code in the learner's view and submit the answer, the assessment showed that the keywords missing and results wrong, which is not the case by the code nor the results. What happened wrong?
e.g. Code: z=sort(x,'descend')
In Assessment: 1. check if keywords used: sort, descend
2. check if the variable z is the same as in the reference solution
Even if the code are correct and z is correct, the auto-assessment shows "descend" is missing and the result is not correct.

Answers (1)

Cris LaPierre
Cris LaPierre on 28 Mar 2022
Edited: Cris LaPierre on 28 Mar 2022
The reason is that descend is not a function or keyword. It is an input argument to the sort function.
exist('descend')
ans = 0
iskeyword('descend')
ans = logical
0
  4 Comments

Sign in to comment.

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!