Search Comments and Ratings

go

Comments and Ratings

   
Date File Comment by Comment Rating
10 Nov 2009 IMWRITESIZE Write image file with specified width and resolution Write a TIFF or PNG image file with specified width (inches) and resolution (dpi). Author: Steve Eddins Yufei

06 Nov 2009 Image overlay Overlay a binary mask onto an image using a specified color Author: Steve Eddins James

23 Oct 2009 Upslope area functions Functions for computing and visualizing upslope area, influence map, dependence map Author: Steve Eddins seviour, Charlie seviour

How do you combine this script with flow data?
If the flow was the same for each pixel I could simply multiple the upslope area by a constant. Since this is not the case I need to find a way of inputting my flow data as it calculates the up slope area.

Can anyone enlighten me,
Charlie

22 Sep 2009 MATLAB xUnit Test Framework MATLAB xUnit is a unit test framework for MATLAB code. Author: Steve Eddins Jader

I found the source of my problem: My test files names did not begun with "Test"

21 Sep 2009 MATLAB xUnit Test Framework MATLAB xUnit is a unit test framework for MATLAB code. Author: Steve Eddins Jader

I couldn't make it work on Matlab R2008b 7.7 and Windows 7
It doesn't finds the m-files with test functions in the current pwd

>> runtests
Starting test run with 0 test cases.

PASSED in 0.000 seconds.

04 Aug 2009 MATLAB xUnit Test Framework MATLAB xUnit is a unit test framework for MATLAB code. Author: Steve Eddins Eddins, Steve

Nick, thanks for the error report about assertElementsAlmostEqual and assertVectorsAlmostEqual. I uploaded a new version (2.0.1) today that fixes the problem.

04 Aug 2009 MATLAB xUnit Test Framework MATLAB xUnit is a unit test framework for MATLAB code. Author: Steve Eddins Eddins, Steve

Nick, the behavior with your setupdata function is a feature. See the doc page called "How to Write Tests That Share Common Set-Up Code."

http://www.mathworks.com/matlabcentral/fx_files/22846/6/content/matlab_xunit/doc/html/exTestFixtures.html

03 Aug 2009 MATLAB xUnit Test Framework MATLAB xUnit is a unit test framework for MATLAB code. Author: Steve Eddins Nick

If you are putting multiple tests in a single file, don't start any function names with "setup". The following code fails. Remove setup and it works.

function test_suite = testFliplr
initTestSuite;
end

function testFliplrMatrix
in = magic(3);
assertEqual(fliplr(in), in(:, [3 2 1]));
end

function testFliplrVector
assertEqual(fliplr([1 4 10]), [10 4 1]);
end

function test3
[a b] = setupdata;
assertEqual(a,1);
assertEqual(b,2);
end

function [a b] = setupdata
a = 1;
b = 2;
end

03 Aug 2009 Image overlay Overlay a binary mask onto an image using a specified color Author: Steve Eddins hima

This code was great.heyy i want the canny edge borders to be black.now they are in green colour.how to get that???

22 Jul 2009 MATLAB xUnit Test Framework MATLAB xUnit is a unit test framework for MATLAB code. Author: Steve Eddins Nick

I think there is a divide by inf in computing the relative tolerance. Using the 'absolute' flag provides the correct result.

22 Jul 2009 MATLAB xUnit Test Framework MATLAB xUnit is a unit test framework for MATLAB code. Author: Steve Eddins Nick

Great software! Thanks. I noticed a bug:

function testStuff
    assertElementsAlmostEqual(0,Inf)
    assertVectorsAlmostEqual(0,Inf)
end

Will not flag a failure.

--N

17 Jun 2009 Image overlay Overlay a binary mask onto an image using a specified color Author: Steve Eddins Rotem

Great work! saved me some precious time...

08 Jun 2009 MATLAB xUnit Test Framework MATLAB xUnit is a unit test framework for MATLAB code. Author: Steve Eddins Frank

Steve, thanks for making this available. I had used xtargets/munit in the past, and while quite powerful, the syntax was different from other *Unit frameworks, which I felt took away from it a little. I've used *Unit in Python, Perl, Java, and C - I'm used to the way they work, I didn't really want to learn a "better" way to do it, much less teach my colleagues to use it. I'm glad to have the familiar framework available now in MATLAB.

As you mentioned in your 2006 talk (I just read the slides), most of us are not primarily programmers - we're scientists, engineers, etc. However, we use languages like Python and MATLAB to express our scientific ideas. I've long been a believer in using software engineering tools to make my *science* better, easier, more reliable and more reproduceable, and I agree that unit-testing is one of the keys to that. Still (as you also point out), it's not widely appreciated in the scientific community, and no scientist ever formally learns about these tools.

Having a simple interface to unit-testing in MATLAB is a big win, in my book. It should make convincing my colleagues to use it a whole easier. Thanks

08 Jun 2009 MATLAB xUnit Test Framework MATLAB xUnit is a unit test framework for MATLAB code. Author: Steve Eddins Eddins, Steve

Ryan, I decided not to do the sprintf-style conversion specifiers in the assert functions, as least for now. My experience designing syntaxes for MATLAB and toolbox functions makes me shy away from a syntax design with an indefinite set of trailing arguments, as in sprintf. Such a syntax design makes it difficult to expand the syntax to support other options in the future. For now, you can just inline a call to sprintf directly in the call to the assertion functions.

12 May 2009 MATLAB xUnit Test Framework MATLAB xUnit is a unit test framework for MATLAB code. Author: Steve Eddins Li, Ming

Thank you for putting this together and provide support for the framework. Great work.

06 May 2009 MATLAB xUnit Test Framework MATLAB xUnit is a unit test framework for MATLAB code. Author: Steve Eddins Eddins, Steve

Ryan and Guido, the Help Browser team has identified the problem and is trying to fix the problem for the next MATLAB release. In the meantime, you can try this workaround: Put the MTEST directory after the MATLAB directories in your path, instead of before them.

Ryan, thanks for the enhancement suggestion. I have received several good suggestions, and I plan to work on an MTEST update soon.

05 May 2009 MATLAB xUnit Test Framework MATLAB xUnit is a unit test framework for MATLAB code. Author: Steve Eddins Ollos, Ryan

I'm also having the issue with the doc browser freezing, but I find it doesn't occur if I type 'doc mtest' from the command line to access the help, rather than trying to expand the entry in the help browser.

>> version
ans =
7.8.0.347 (R2009a)

One small feature request would be to allow messages with sprintf style conversion specifiers.

28 Apr 2009 MATLAB xUnit Test Framework MATLAB xUnit is a unit test framework for MATLAB code. Author: Steve Eddins Ollos, Ryan

This is very nicely written, and useful. For those MATLAB coders that desire to learn better practices.

23 Apr 2009 MATLAB xUnit Test Framework MATLAB xUnit is a unit test framework for MATLAB code. Author: Steve Eddins Eddins, Steve

Hi again Guido,

The Help Browser team was able to reproduce the problem you reported, and they are investigating it. I don't know yet if there's a work-around I could apply to the MTEST doc files.

Steve

21 Apr 2009 TIMEIT Benchmarking Function TIMEIT.M measures the time required to call a user-specified function Author: Steve Eddins Henriques, Joao

This is extremely useful, but since it requires a function definition, you must either use lambdas, which don't allow procedural code (ie, a list of statements), define a local function, which means you have to turn your script into a function file (sometimes not desirable when dealing with workspace variables), or create a new file (lots of throwaway files with simple routines).

I wonder if it would be possible to add the following functionality (either in the same function or through a different one) :

while timeit %returns true when a new measurement is needed
  ... my procedural code ...
  ... multiple lines, will run as many times as timeit() sees fit ...
end
result = timeit; %next call: return result. reset state.

As you can see, this sort of usage would be tremendously useful to just profile a piece of code with no extra details -- just wrap it in a loop. Of course, it's only fair if you conclude it's not worth the additional effort :)

20 Apr 2009 MATLAB xUnit Test Framework MATLAB xUnit is a unit test framework for MATLAB code. Author: Steve Eddins Eddins, Steve

Hi Guido,

I have not been able to reproduce the problem using R2009a on my 32-bit WinXP SP3 machine.

Would you please double-check your MATLAB version? I believe the released version was 7.8.0.347, not 7.8.0.324 as you reported.

Thanks,

Steve

20 Apr 2009 MATLAB xUnit Test Framework MATLAB xUnit is a unit test framework for MATLAB code. Author: Steve Eddins gg

Steve, thank you for MTEST available I find it very useful.

Nevertheless I encountered a problem involving the mtest help-file. Choosing "MTEST Unit

Test Framework" in the help window causes Matlab to freeze. No input (mouse and keyboard) is

accepted and the application needs to be terminated by the task-manager. This problem can be

replicated by different users on different machines.

Details to replicate the problem:

- Copy Mtest to <mtest-dir>
- "Add Path with Subfolders" <mtest-dir>
- Open help in Matlab
- click on "MTEST Unit Test Framework"
=> Freeze

All other mtest help entries work as expected.

Matlab version: R2009a, 7.8.0.324 (win32)
OS: Windows XP Professional, 5.1.2600 SP3

It is really more a nuisance than a no-go but maybe you can track down the problem.

Thank you & kind regards
Guido

16 Apr 2009 MATLAB xUnit Test Framework MATLAB xUnit is a unit test framework for MATLAB code. Author: Steve Eddins vera, Shi

That's exactly what i need! Thank you very much!

12 Mar 2009 MATLAB xUnit Test Framework MATLAB xUnit is a unit test framework for MATLAB code. Author: Steve Eddins Bosi, Rick

What can I say... Thank you for building and providing this. This should be part of the base MATLAB package!

11 Mar 2009 MATLAB xUnit Test Framework MATLAB xUnit is a unit test framework for MATLAB code. Author: Steve Eddins Ollos, Ryan

06 Mar 2009 Line-wrap a string Break a string into multiple lines Author: Steve Eddins dash, matt

04 Mar 2009 Image overlay Overlay a binary mask onto an image using a specified color Author: Steve Eddins paddy84

This is an excellent bit of code. It worked perfectly fine in my case.

03 Mar 2009 TIMEIT Benchmarking Function TIMEIT.M measures the time required to call a user-specified function Author: Steve Eddins Eddins, Steve

Paolo, thanks for the suggestion. I'll look into it.

24 Feb 2009 TIMEIT Benchmarking Function TIMEIT.M measures the time required to call a user-specified function Author: Steve Eddins de Leva, Paolo

A suggestion to improve accuracy when you measure small execution times. I believe it would be useful to subtract from median(times) the time needed for the inner iterations (“offset”). Here is the code:

[…omissis…]
offsets = zeros(num_outer_iterations, 1);
times = offsets;
for k = 1:num_outer_iterations
    t1 = tic;
    for p = 1:num_inner_iterations
    end
    offsets(k) = toc(t1);
end

for k = 1:num_outer_iterations
    t1 = tic;
    for p = 1:num_inner_iterations
        [outputs{:}] = f();
    end
    times(k) = toc(t1);
end
 
t = (median(times-offsets)) / num_inner_iterations;
[…omissis…]

This offset is not always negligible, especially when you want to time the execution of very quick commands or functions. Notice that the value of each element of variable “offsets” also include the time needed to execute

t1 = tic; times(k) = toc(t1);

On my system, this is very small (1.7321e-005 s), but not negligible when testing the execution of very quick commands, such as RESHAPE.

Paolo de Leva

09 Dec 2008 Image credit string Display image credit string at bottom of image Author: Steve Eddins Jamleh, Hani

30 Oct 2008 TIMEIT Benchmarking Function TIMEIT.M measures the time required to call a user-specified function Author: Steve Eddins Eddins, Steve

Anna - thanks. I just updated the file to fix the nargout problem.

28 Aug 2008 Visualize output of BWLABEL The function VISLABELS is used to visualize the output of BWLABEL. Author: Steve Eddins Camboim, Paulo

Great! helped a lot for me on learning connected components.

Excellent

03 Aug 2008 Image overlay Overlay a binary mask onto an image using a specified color Author: Steve Eddins El-Badry, Waleed

that's an excellent piece of code.

18 Jul 2008 Upslope area functions Functions for computing and visualizing upslope area, influence map, dependence map Author: Steve Eddins Hebeler, Felix

After implementing Tarbotons Dinf algorithm for calculating flow directions I finally stumpled upon your toolbox, which is a lot faster. Thanks for the implementation, maybe if you add a keyword 'flow direction' it could save some other users some work ;-)

04 Jul 2008 Visualize output of BWLABEL The function VISLABELS is used to visualize the output of BWLABEL. Author: Steve Eddins E, Peter

works great for me. exactly what I was looking for. thanks a lot for this.

25 Jun 2008 Lab color scale Create color scale that prints well on grayscale printers Author: Steve Eddins Tumlinson, Alexandre

Take a look at 'colorGray' which has similar functionality but with "rainbow" like color spectrum.

28 May 2008 Visualize output of BWLABEL The function VISLABELS is used to visualize the output of BWLABEL. Author: Steve Eddins Eddins, Steve

Saurabh - I give your bug report 2 stars. :-) There isn't enough information there for it to be useful. If you had included specific reproduction steps, I might be able to diagnose the problem. Also, please note that I do not normally test my File Exchange submissions on 4-year-old versions of MATLAB.

20 May 2008 Visualize output of BWLABEL The function VISLABELS is used to visualize the output of BWLABEL. Author: Steve Eddins Sharma, Saurabh

its not qorking for me.. i use matlab 13 sp1
Warning: Input arguments must be scalar.
> In C:\Documents and Settings\501633799\Desktop\New Folder\patent_implementation\vislabels.m at line 27
Warning: Input arguments must be scalar.
> In C:\Documents and Settings\501633799\Desktop\New Folder\patent_implementation\vislabels.m at line 27
??? In an assignment A(I) = B, a matrix A cannot be resized.

Error in ==> C:\Documents and Settings\501633799\Desktop\New Folder\patent_implementation\vislabels.m
On line 28 ==> I(L == 0) = background_shade;

19 Apr 2008 TIMEIT Benchmarking Function TIMEIT.M measures the time required to call a user-specified function Author: Steve Eddins Nowak, Anna

Small remark - nargout parameter is sometimes less than 0. I had -1 result when there was no output arguments from function.

In case of problems with error "Too many output argument" juz change line :
num_outputs = ~(nargout(f) == 0);
to
num_outputs = ~(nargout(f) <= 0);

Still excellent file!

11 Mar 2008 Image overlay Overlay a binary mask onto an image using a specified color Author: Steve Eddins Vargas Aguilera, Carlos Adrián

Great tool. Now I can paint NaN's in black on imagesc.

Thanks

20 Feb 2008 TIMEIT Benchmarking Function TIMEIT.M measures the time required to call a user-specified function Author: Steve Eddins D'Errico, John

Ok, this does nothing exotic. But what it does it does well. Its a simple way to time your code without worrying about some of the extra bookkeeping, like warming up the codes to make sure you get an accurate assessment of the time required, plus taking the median of the time over multiple runs.

The help and the code is as good as you would expect from this source.

01 Dec 2007 Image overlay Overlay a binary mask onto an image using a specified color Author: Steve Eddins Misevski, Robert

Great tool work very well for what a needed to do.

03 Sep 2007 Image overlay Overlay a binary mask onto an image using a specified color Author: Steve Eddins Eddins, Steve

Matt - I added a note and an example to the documentation based on your suggestion. Thanks!

03 Sep 2007 Hough accumulator bin pixels Find the pixels in a binary image corresponding to a particular Hough transform bin Author: Steve Eddins Fargeon, Ditza

Simple and nice one

31 Aug 2007 Image overlay Overlay a binary mask onto an image using a specified color Author: Steve Eddins SUn, Phillip

great and loved it

20 Aug 2007 Upslope area functions Functions for computing and visualizing upslope area, influence map, dependence map Author: Steve Eddins Schwanghart, Wolfgang

Hi Steve,

areas of interest to geographers often are catchments which commonly have irregular shape. Beyond the watersheds there is often a lack of data. Hence, these values outside the catchment are NaNs. While NaNs inside the catchment may be interpolated the NaNs outside can merely be extrapolated.

Hence, I tried following. I replaced the NaNs in the DEM by -Inf. That works except that it produces an erroneous flow direction on the watershed pixels.

Best regards,
Wolfgang

20 Aug 2007 Upslope area functions Functions for computing and visualizing upslope area, influence map, dependence map Author: Steve Eddins Eddins, Steve

Hi Wolfgang,

Do you have opinion about should be done with NaNs?

Thanks, Steve

19 Aug 2007 Upslope area functions Functions for computing and visualizing upslope area, influence map, dependence map Author: Steve Eddins Schwanghart, Wolfgang

Hi Steve,

great contribution! Users of older Matlab versions (R14) need to replace the function hypot(s1,s2) by
s = sqrt(abs(s1).^2 + abs(s2).^2)

One critique: The functions don't handle NaNs.

Best regards, Wolfgang

14 Aug 2007 Image overlay Overlay a binary mask onto an image using a specified color Author: Steve Eddins r, B

18 Jul 2007 Image overlay Overlay a binary mask onto an image using a specified color Author: Steve Eddins Whitaker, Matt

Simple, useful and well styled and coded. Did something in my existing code similar but this is a bit faster and less memory. Steve, you might want to note in the documentation that if you have a double input outside the range of 0-1 (soemthing you typically use imagesc to display) that you would want to run mat2gray on it before passing to this function. A useful further enhancement would be either to auto detect and apply this or have an optional switch.

 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com