Matlab

Re: Matlab

by David Forehand -
Number of replies: 0

Hi Richard,

Thanks very much again for your very quick response yesterday.  I’ve now had time to digest it and here is my proper reply.

Thanks, I’m really glad I haven’t broken CodeRunner – I was worried about that.  I downloaded your new demooctavequestion.xml in the current export format and it works fine.

About my second snippet, involving the symbolic maths package.  After your advice, I think I’ll drop that question.  It sounds way too complicated for me to implement at the moment.

About my other two questions, yes, sorry, I composed my questions before I had really looked into CodeRunner.   For the last question, the “roots” question, I will be giving them a specific polynomial in the question text and I will be looking for them to enter something like:

roots([2 -3 0 -1])

As a result, I think it will be difficult to write test cases for this?  That is, there will be no variable, like the variable “mat” in the example you kindly supplied, to run test cases on.  What I was hoping to do was just to look at the output of the above command, check its size (for the above case it should be 3x1 because it is the roots of a cubic) and check it is close to my solution.  Maybe you were suggesting this in the final part of your response above, but, sorry, I wasn’t really following what you meant?

For my first question, again I will be giving them a specific function f in the question text.  I was then going to check their x by looking at its size and checking that it was close to my x (I would also do similar checks on their f).  Finally, following your example in your “Question authoring 2: customising questions” youtube video, I was thinking of just checking for a string “plot(“ and a string (“x,f” or “x, f” or “x ,f” or “x , f”) in the student answer, then I would accept that.  I know this last check is a bit of a hack.

I’m a bit unsure of the template and code I would use for these two questions?

All the Best and thanks very much again for your help,

David