Steve on Image Processing

March 19th, 2009

MTEST update, plus Help Browser integration info

Earlier this week I posted an update to my MTEST unit test framework on the File Exchange. I wasn't completely happy with my assertion function for comparing floating-point numbers using a tolerance, so I added two new ones: assertElementsAlmostEqual and assertVectorsAlmostEqual. I also fixed a problem with the way mtest was scanning the current directory in order to find test files.

Last week someone asked me about integrating the MTEST doc in the MATLAB Help Browser, so I looked into that. It is possible, as it turns out. There's a detailed explanation of how to do that in the MATLAB Helper Browser documentation. See the section on Adding HTML Help Files for Your Own Toolbox. Using this explanation, I was able to have the MTEST documentation appear in the Help Browser. If you distribute your own MATLAB code for others you use, you might want to give this a try.

4 Responses to “MTEST update, plus Help Browser integration info”

  1. James Ong replied on :

    Is is just me, or has AssertAlmostEqual disappeared from the main documentation of mtest?

  2. Steve replied on :

    James—Yes, assertAlmostEqual has disappeared from the main documentation. That was intentional. The explanation is in the first paragraph of this post. I have the new floating-point comparison functions assertElementsAlmostEqual and assertVectorsAlmostEqual. I left assertAlmostEqual there to avoid making an incompatible change, but I would prefer that people use the new functions.

  3. James Ong replied on :

    Ah, then I’ll change my test functions to not use assertAlmostEqual any more.

    By the way, your post on MTEST and refactoring made me read through the books “Test-driven development” (Beck) and “Refactoring” (Fowler) plus try programming MATLAB in an object oriented way. I’m still assessing the advantages and disadvantages for my work, but the most obvious at the moment are:
    - the code is more robust than I’m used to
    - the development time is somewhat slower than I’m used to

  4. Steve replied on :

    James—That’s a lot of changes to try all at once! Test-driven development and object-oriented programming both take some getting used to. Some programmers find that development pace actually speeds up with test-driven development, because the fraction of time spent debugging goes way down. But that’s only after you have some experience with the technique, and only if you get in the habit of making code changes in small, rapid increments.

Leave a Reply

Wrap code fragments inside <pre> tags, like this:

<pre class="code">
a = magic(3);
sum(a)
</pre>

If you have a "<" character in your code, either follow it with a space or replace it with "&lt;" (including the semicolon).


Steve Eddins manages the Image & Geospatial development team at The MathWorks and coauthored Digital Image Processing Using MATLAB. He writes here about image processing concepts, algorithm implementations, and MATLAB.

  • Steve: Kezia—Try imrotate.
  • kezia: steve, how to perform rotation of structuring element by 15 degrees. kindly answer my question. thank u kezia...
  • Steve: Tasha—I only accept comments that are relevant to the particular blog post or are questions or comments...
  • Tasha: Steve,I send you a comment here but still didn’t get any reply yet.I did not see my comment posted here...
  • Steve: Carsten—Thanks for your input.
  • Carsten: Another vote for either imtranslate.m, or at least a blurb in the imtransform help why pure translation...
  • Loren Shure: If you look towards the end of the fftfilt program, you will see that there’s a check to see if...
  • Steve: Sonja—My imwritesize submission on the MATLAB Central File Exchange might be helpful. It was posted...
  • Steve: Grant—Sorry, but it won’t be for R2010a. That development deadline has already passed.
  • Sonja: My publisher is wanting images for a new book to be 300 dpi. Only 5 of the 19 images are 300, the rest are...

These postings are the author's and don't necessarily represent the opinions of The MathWorks.