Search Comments and Ratings

go

   
Date File Comment by Comment Rating
02 Mar 2015 Round to X Rounds the supplied N-D matrix to the values in a supplied array. Author: Owen Brimijoin Owen Brimijoin

@Stephen Cobeldick: a revised version has now been posted to the FileEx based on your recommendations. All of them have been implemented, save one: the addition of a 'fix' method. The reason it hasn’t been implemented is that I am not convinced it should be. I can certainly BE convinced, but here’s a scenario for you and the file exchange community to puzzle over:

data = 0.1;
roundvals = [-10, 5, 10];

The result of using a ‘fix’ method here would be for the data to be rounded away from zero, to 5.0, which is a bit counterintuitive to the user who has just typed in ‘fix!’

Within the round-to-x framework, ‘fix’ in essence serves two masters, rounding not towards zero, but rather toward the supplied value that has the smallest absolute value. I think it’s confusing, but I’d greatly appreciate thoughts on the subject. I am fully prepared to admit that there may be uses for this code behavior that I am not seeing.

Comment only
27 Feb 2015 Round to X Rounds the supplied N-D matrix to the values in a supplied array. Author: Owen Brimijoin Owen Brimijoin

Thank you, Stephen, for working this function over and finding the bits that are in sore need of improvement. I was hoping someone might do exactly this! Based on your helpful suggestions, a new version will be forthcoming as soon as I find a spare evening to work on it.

Comment only
27 Oct 2014 Kautz sequence generator Generates example Kautz sequences of specified number of characters and subsequence lengths. Author: Owen Brimijoin Owen Brimijoin

@memoly

This example you are showing here seems to me to be a legitimate 3^3 Kautz sequence. Could you explain why you've identified these particular substrings as incorrect?

The condition of the Kautz sequence is not that there be no repeated characters in a substring (in your case, each set of 3), rather that the sequence simply not contain any *consecutive* repeats of the same character.

Comment only
07 Oct 2014 Circular Statistics Toolbox (Directional Statistics) Compute descriptive and inferential statistics for circular or directional data. Author: Philipp Berens

Philipp Berens (view profile)

Owen Brimijoin

indispensable

5
17 Sep 2014 de Bruijn sequence generator Generates example de Bruijn sequences of specified number of characters and subsequence lengths. Author: Owen Brimijoin Owen Brimijoin

@vinod

In its current form, no, there is no way to force it to generate all possible 4^2 sequences short of exhaustively running the function in a while loop and checking for unique results until all 16 are generated (not particularly efficient, to put it mildly).

Comment only
28 Jun 2013 Oscillator and Signal Generator A simple command-line function for generating standard waveforms, click trains and noise bursts. Author: Owen Brimijoin Owen Brimijoin

Oops.. my mistake, "chirp.m" is only included in the Signal Processing toolbox! I have updated the function to include simple linear and logarithmic sweep options. For these you need to provide a [start stop] vector of frequencies.

To the list of signal options, I have also added brown noise (1/f^2) and grey noise. Mind you, it's a generic grey (ISO Equal-Loudness at 60 phons), since *true* grey noise must be custom defined to match each listener's psychoacoustic loudness contour.

The updated version has been submitted and should pop up soon.

Comment only
24 Jun 2013 Oscillator and Signal Generator A simple command-line function for generating standard waveforms, click trains and noise bursts. Author: Owen Brimijoin Owen Brimijoin

I am so glad you find this submission helpful, Deborah. Excellent suggestions, I will certainly add more noise forms as soon as I can compute the best filter coefficients I can. Watch this space for grey noise and brown noise, among others.

I am, however, hesitant to add support for frequency sweeps because I think it would complicate the currently simple input argument structure. What's more, there is the built-in Matlab 'chirp.m' function that does a bang-up job of making fm signals!

Comment only
29 May 2013 de Bruijn sequence generator Generates example de Bruijn sequences of specified number of characters and subsequence lengths. Author: Owen Brimijoin Owen Brimijoin

@Mahdiyar - from the error you are getting, I'd guess that you haven't put the m-file in a directory that Matlab knows anything about. Either use addpath or place the file in your current directory and it should work just fine.

Comment only
05 Apr 2013 absmax Returns the value of the element with the largest absolute value in the input matrix. Author: Adam McNeilly Owen Brimijoin

What about this alternate (and arguably simpler) means of solving the problem:

A(abs(A)==max(abs(A(:))))

Hooray for logical indexing!

Comment only
04 Apr 2013 Create and activate figures by name Finds and activates, or creates, figure with user-specified name. Author: Brett Shoelson

Brett Shoelson (view profile)

Owen Brimijoin

Only just found this function this morning - but it made my day.

5
26 Mar 2013 function making input twice calculate double of a number by just passing the number in the argument of the function Author: tushar kataria Owen Brimijoin

There are other ways of solving this problem. I have here a humble suggestion:

function y = myfun(x)
tic;
pause(2*x)
y = toc;

Note that for large values of x, this may take some time to execute. It also may not return a precise value.

Comment only
19 Aug 2011 de Bruijn sequence generator Generates example de Bruijn sequences of specified number of characters and subsequence lengths. Author: Owen Brimijoin Owen Brimijoin

@fan

It’s a bit of a needle-in-the-haystack problem. While it’s true there are many valid (k,n) de Bruijn sequences (this many: factorial(k)^(k*(n-1))/k*n), there are k^(k^n) possible ways to combine k characters in a sequence of equal length!

This m-file keeps a *simple* history of dead-ends in its attempt to find a valid sequence, the simplicity of it being an advantage in avoiding out-of-memory problems, but I do not doubt there are better ways to do it. Suggestions are most definitely appreciated!

Comment only
22 Jul 2011 COMBN (4.3) All combinations of N elements taken from the vector V. Author: Jos (10584)

Jos (10584) (view profile)

Owen Brimijoin

The core of this function is a lovely little computational gem. Thank you.

5
29 Jun 2011 de Bruijn sequence generator Generates example de Bruijn sequences of specified number of characters and subsequence lengths. Author: Owen Brimijoin Owen Brimijoin

In principle you could reseed Matlab's random number generator to the same value each time:

rand('seed',0);
sequence1 = debruijn_generator(5,3)
rand('seed',0);
sequence2 = debruijn_generator(5,3)

These ought to be the same. On the other hand, there is no reason you could not simply save a given sequence and load it whenever you need it.

Comment only
14 Jul 2010 LATSQ (randomized) Latin Square Author: Jos (10584)

Jos (10584) (view profile)

Owen Brimijoin

5

Contact us