MATLAB Answers

In MATLAB Grader, how can I assess students' output? All I can do is to compare variables or keywords

5 views (last 30 days)
Hyunjee Yoon
Hyunjee Yoon on 31 Jul 2020
Answered: Cam Salzberger on 31 Jul 2020
In MATLAB Grader, how can I assess students' output? All I can do is to compare variables or keywords
I want to make an exercise problem about printing star triangle out, as shown below.
*
***
*****
*******
*********
***********
However, it's quite tricky to make assessments
I can check whether they used the key word "for", and "fprintf", but not the results
this assessment will pass all the solutions with the keywords.
Will it be available to make variables about the output????

  0 Comments

Sign in to comment.

Answers (1)

Cam Salzberger
Cam Salzberger on 31 Jul 2020
Hello Hyunjee,
As you specify the code to call the student's provided functions or scripts, you could call it within an evalc call. This will capture anything that would normally be printed to the command window, which you can then check for the presence of the asterisk pyramid.
-Cam

  0 Comments

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!