Using Matlab Grader to check correct name-value pair was used

조회 수: 1 (최근 30일)
Angela Jones
Angela Jones 2020년 3월 31일
답변: Cris LaPierre 2020년 4월 1일
I'm using Matlab Grader for the very first time. I want to use it for a statistics class, so I'm using the statistics package with Matlab. Many of the commands are correct only if you use the correct name-value pair. For example, if I want to do a two-sample t-test for samples with unequal variance I must specify the following command:
ttest2(x1,y,'Vartype','unequal')
I can easily use Matlab Grader to check that they function ttest2 was used, but I also want to confirm the students used the correct 'Vartype'. How do I create a test in Matlab Grader for that?

채택된 답변

Cris LaPierre
Cris LaPierre 2020년 4월 1일
MATLAB Grader does not have a built-in way to test name value pairs.
If I were going to assess this, I would test the following (in this order)
  1. x1 is correct
  2. y is correct
  3. ttest2 is used
  4. output of ttest2 is correct
In test 4, if the output were not correct, I would remind students to check their name-value pairs in the feedback. It could be as obvious as giving them the correct syntax, or could just be a reminder to check that they are using the correct Vartype. You can even include a hyperlink that will take them directly to the Vartype section of the online documentation for ttest2.
You should adapt the feedback to fit your desires for the learner experience as well as be appropriate for what your learners already know.

추가 답변 (0개)

커뮤니티

더 많은 답변 보기:  원격 교육 커뮤니티

Community Treasure Hunt

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

Start Hunting!

Translated by