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 件)

コミュニティ

カテゴリ

Help Center および File ExchangeCreate or Copy Coding Problems についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by