
- HOW DO I SEARCH JUST MATLAB R2013A DOCUMENTATION HOW TO
- HOW DO I SEARCH JUST MATLAB R2013A DOCUMENTATION SOFTWARE
- HOW DO I SEARCH JUST MATLAB R2013A DOCUMENTATION CODE
We also showed how you can use this infrastructure to provide an aid/check for the students that you can also use as part of your grading.

HOW DO I SEARCH JUST MATLAB R2013A DOCUMENTATION CODE
We checked that the student's code worked (by returning the correct answer) for one valid value and worked (by throwing an error) for one invalid value. In this post, we showed you the basics of using the new MATLAB unit testing infrastructure using homework grading as a use case. PercentPassed = 100 * nnz() / numel(results) ĭisp() InstructorTest/fibonacciOf5 X Failed by verification.īenjamin, whose code we tested above, wrote a correct solution to the homework problem. In H:\Documents\LOREN\MyJob\Art of MATLAB\instructorTest.m (instructorTest.fibonacciOf5) at 10

In C:\Program Files\MATLAB\R2013a\toolbox\matlab\testframework\+matlab\+unittest\+qualifications\Verifiable.m (Verifiable.verifyEqual) at 411 > The values are not equal using "isequaln". rmpath( 'thomas') Ģ if (n ~= round(n)) || n NumericComparator failed. In H:\Documents\LOREN\MyJob\Art of MATLAB\errorCaseTest.m (errorCaseTest.fibonacciOfNonintegerShouldError) at 9ĮrrorCaseTest/fibonacciOfNonintegerShouldError X Failed by verification.Īnother student, Benjamin, checked for a non-integer value in his code as you can see on line 2. In C:\Program Files\MATLAB\R2013a\toolbox\matlab\testframework\+matlab\+unittest\+qualifications\Verifiable.m (Verifiable.verifyError) at 637 dbtype basicTest.m 1 classdef basicTest The function did not throw any exception. Throughout the rest of this post we will add additional pieces to this basic framework to increase the capability of this test and will change its name to reflect its increased functionality. The most basic MATLAB unit test is a MATLAB classdef class file that inherits from the class. The Fibonacci numbers are generated by thisį(n) = F(n-1) + F(n-2) for integer n > 1 Your function should throw an error if n is not a nonnegative integer. The exact problem statement you give the students is: Create a function "fib" that accepts a nonnegative integer n and returns Problem StatementĪs a professor in an introductory programming class, you want your students to write a program to compute Fibonacci numbers.

The object-oriented programming documentation describes these capabilities.
HOW DO I SEARCH JUST MATLAB R2013A DOCUMENTATION HOW TO
In order to use this feature, you should be aware of how to define simple MATLAB classes in classdef files, how to define a class that inherits from another, and how to specify attributes for methods and properties of those classes. Basic Test for Students, Advanced Tests for Instructor.For more information we refer you to the MATLAB Unit Testing Framework documentation. There is a great deal of functionality in this feature that we will not show here. That's not to say that the developers in the audience should move on to the next post you can use these tools to test your own code just like a professor can use them to test code written by his or her students.
HOW DO I SEARCH JUST MATLAB R2013A DOCUMENTATION SOFTWARE
In this post, we will describe one way someone who may not consider themselves a software developer may be able to take advantage of this framework using the example of a professor grading students' homework submissions. If you're not a software developer, you may be wondering if this feature will be of any use to you. In release R2013a, MathWorks included in MATLAB itself a MATLAB implementation of the industry-standard xUnit testing framework. Blogger Steve Eddins wrote one highly rated example back in 2009.

There are several submissions on the MATLAB Central File Exchange related to unit testing of MATLAB code. Steven Lord, Andy Campbell, and David Hruska are members of the Quality Engineering group at MathWorks who are guest blogging today to introduce a new feature in R2013a, the MATLAB unit testing infrastructure.
