Search Comments and Ratings

go

Comments and Ratings

   
Date File Comment by Comment Rating
29 Oct 2009 GetKeyWait Wait a certain time for a single keypress (v2.0, apr 2009). Author: Jos Hopkins, Jesse

Just what I was looking for

15 Sep 2009 GetKeyWait Wait a certain time for a single keypress (v2.0, apr 2009). Author: Jos Negahbani, Ehsan

Great. Thank you Jos.
Is it possible to prevent the appearance of figure tab in the task bar?
I'm calling your function in a loop every second, and it works well, but there is continuous blinking between command window and windows task bar as your code opens and closes a figure window each time. I tried to off the 'visible' property of the figure, but it was not working...

11 Sep 2009 RANDP Random integers with given probabilities ( (v2.0) Author: Jos Pozzi, Francesco

I've tried this small experiment:

N = 100000; % sample size
w = 1:100; % quite steep distribution
w = w / sum(w); % distribution (pdf)
Y_std = sqrt(w .* (1 - w)); % Standard deviations associated to each probability

%%%%%%%%%%%%%%%%%

Y1 = randp(w, N, 1); % Try Jos function
Y1_w = histc(Y1, [1:100]); % absolute frequencies table
Y1_w = Y1_w / N; % transform into relative frequencies
Y1_w_std = sqrt(Y1_w .* (1 - Y1_w)); % Empirical standard deviations associated to each probability

%%%%%%%%%%%%%%%%%

Y2 = gDiscrPdfRnd(w, N, 1); % Try Gianluca Dorini's function
Y2_w = histc(Y2, [1:100]); % absolute frequencies table
Y2_w = Y2_w / N; % transform into relative frequencies
Y2_w_std = sqrt(Y2_w .* (1 - Y2_w)); % Empirical standard deviations associated to each probability

%%%%%%%%%%%%%%%%%

% Check if empirical standard deviations are coherent with theretical ones
plot(Y_std - Y1_w_std', '.b') % plot empirical differences for Jos function
hold on
plot(Y_std - Y2_w_std', '.r') % plot empirical differences for Gianluca Dorini's function

%%%%%%%%%%%%%%%%%

It looks as though both functions statistically behave very well. They are both excellent functions. Thank you.

04 Sep 2009 MATCHROW (v1.1, may 2008) Match elements in the rows of a matrix Author: Jos Romero, Mauricio

04 Sep 2009 RANDP Random integers with given probabilities ( (v2.0) Author: Jos Pozzi, Francesco

Wow, it really is a nice function, very fast and efficient. It is exactly what I was looking for. Thank you.

11 Aug 2009 INSERTROWS (v2.0, may 2008) Insert rows into a matrix at specific locations Author: Jos Oldenhuis, Rody

I agree with John; this should be part of standard matlab. Well documented, short & simple, vectorized and ample documentation & comments; excelent.

06 Aug 2009 ALLCOMB All combinations of input Author: Jos Asoni, Andrea

very useful. it is possible to have the exact same thing for symbolic objects (i am working with tomSym)?

17 Jul 2009 CATSTRUCT Concatenate structures (v2.2, oct 2008). Author: Jos Otterson, Scott

This works well. I agree with Jeremy that recursive concatenation would be an advantage. It would also be useful to concatenate arrays and cells at the leaf nodes in the case when the fieldnames match (I've had to do this many times).

But it works for what I'm doing at the moment. Thanks!

01 Jul 2009 PADCAT concatenate vectors with different lengths by padding with NaN (v1.0, feb 2009) Author: Jos Johns, Laurence

21 Jun 2009 RANDP Random integers with given probabilities ( (v2.0) Author: Jos Baiz, Carlos

Works great!

19 Jun 2009 ALLCOMB All combinations of input Author: Jos Jun, Tsinghua

so powerful, it is what I've been looking for~~

04 Jun 2009 PADCAT concatenate vectors with different lengths by padding with NaN (v1.0, feb 2009) Author: Jos Conover, Kent

Works as advertised - many thanks!

14 May 2009 CIRCULANT (v2.0, feb 2009) (yet another, but fast) Circulent Matrix Author: Jos Fierro, Massimo

09 May 2009 RANDSWAP randomly swap elements of a matrix Author: Jos Grey, Kevin

Great! This is exactly what I wanted. For network analysis of Quadratic Assignment Procedure (QAP), this step is pre-required.

06 May 2009 GRIDXY (v2.2 feb 2008) plot horizontal and vertical grid Author: Jos Jos

@Chiara. You can use, e.g.,
 h(1) = gridxy(MedianValue ,'color','r')
 h(2) = gridxy(MeanValue ,'color','b')
legend(h,{'Median','Mean'})

hth
Jos

06 May 2009 GRIDXY (v2.2 feb 2008) plot horizontal and vertical grid Author: Jos Chiara

Very useful - but i'd need to add a legend with entries for the vertical bars. EG i have a histogram, and two vertical bars, say one for the mean and one for the median. How can i do this?

06 May 2009 GRIDXY (v2.2 feb 2008) plot horizontal and vertical grid Author: Jos Jos

@Phil, in 3D the lines would become planes. Is this what you want? You can also take a look at REFLINEXYZ to see if that better fills your needs:
http://www.mathworks.com/matlabcentral/fileexchange/16746

05 May 2009 GRIDXY (v2.2 feb 2008) plot horizontal and vertical grid Author: Jos Phil

Hello everyone,

this code is exactly what I need. Unfortunately I need it in three dimensions. Does any body have an idea?

Otherwise I will try to extend this m-file but I have a feeling that this will take me lots of time

thanks

Philipp

05 May 2009 HERRORBAR Horizontal errorbar plot. Author: Jos Jordan

How do I put vertical end markers on my horizontal error bars? The code worked great to put them in but I have data points that overlap substantially so I need end markers to show their bounds.

thanks

08 Apr 2009 CATSTRUCT Concatenate structures (v2.2, oct 2008). Author: Jos Schreiber, Gabriel Akira

great work, may the sun always shine on you.

07 Apr 2009 RUNMEAN Version 3.0 (sep 2006) Very fast running mean (aka moving average) filter Author: Jos Winkler, Thomas

06 Apr 2009 KTHVALUE select the k-th smallest element in a (randomized) list Author: Jos Jos

@Luigi: To be honest, I suggest that you use SORT in all cases ... the gain in using KTHVALUE is small. And it is not so much the value of K that determines its running time. This submission is to be regarded as a programming exercise.

06 Apr 2009 UNIQUEWITHEQUALNANS Set unique, treating NaNs as equal (v2.0, mar 2009) Author: Jos Jos

@Hoi Wong: apparently TMW changed the internals of UNIQUE, so it is no longer backward compatible. I will update this function shortly.

05 Apr 2009 UNIQUEWITHEQUALNANS Set unique, treating NaNs as equal (v2.0, mar 2009) Author: Jos Wong, Hoi

Great tool. But you cannot just pass [] into unique as second argument. I modified it for my own use, but I'd encourage the original author to update it instead of having me posting a minor modification of your work. :)

05 Apr 2009 KTHVALUE select the k-th smallest element in a (randomized) list Author: Jos Giaccari, Luigi

Nice One,

Well commented and written,

it is also fast for high K/Numel(L) ratio, but I thing for a smaller K, 1-2-3 , brute search would be faster.

 So if I can suggest an improvement I would switch to brute search in those cases. Am I wrong?

03 Apr 2009 GRIDXY (v2.2 feb 2008) plot horizontal and vertical grid Author: Jos Wong, Hoi

Great Program. It'd be even better if it can accept an axes handle as its first input. For the moment, since I need it in a hurry, I tapped into your code and changed this:

function hh = gridxy(hca, x,varargin)

if(isempty(hca))
hca=get(get(0,'currentfigure'),'currentaxes')
end

23 Mar 2009 COMBN All combinations of N elements taken from the vector V. Author: Jos Baiz, Carlos

Thanks!

13 Mar 2009 RANDPERMFULL Random full permutation (derangement) (v2.1, march 2009) Author: Jos us

one of the typical josians:
excellent in any way a ML novice or seasoned ML connoisseur may look at it
- exhaustive help and examples
- thorough error checking
- sleek and optimized computational engine
- guiding comments including computational alternatives
- useful for many fields of application
us

09 Mar 2009 INSERTROWS (v2.0, may 2008) Insert rows into a matrix at specific locations Author: Jos Rubi

excellent file n.n thanks a lot, i had a terrible headache trying to use a for with this t=[t(1,:);[1 1];t(2:end,:)] !!

23 Feb 2009 NEARESTPOINT NEARESTPOINT - find the nearest value in another vector Author: Jos Ashby, Michael

Simple to use and understand. Thanks for the code and helpful documentation.

19 Feb 2009 PERMPOS all possible permutations of M values in N positions Author: Jos Anders

Exactly what is needed when finding syndromes for the corresponding bit error patterns when making a decoder for block codes

18 Feb 2009 FACTORIALRATIO Ratio of factorials, as in (a!b!c!...) / (d!e!f!g!...) Author: Jos D'Errico, John

Sorry, I forgot to point out what I feel to be one of the best features of this code - the copious internal comments that explain how it works.

I've often argued that the best MATLAB code should aim for a 1-1 ratio of comments to lines of code. That is, each line of code should have an associated comment line, at least in those places where the code is doing something tricky. This code goes beyond my aim. People interested in how to write good comments should look at what the author did here and learn from it.

18 Feb 2009 FACTORIALRATIO Ratio of factorials, as in (a!b!c!...) / (d!e!f!g!...) Author: Jos D'Errico, John

Good help as you would expect from Jos. Well written. An interesting solution for the computation itself.

07 Feb 2009 CIRCULANT (v2.0, feb 2009) (yet another, but fast) Circulent Matrix Author: Jos Jos

An update that resolves a bug in forward shifts has been submitted. Please wait for version 2.0.

06 Feb 2009 CIRCULANT (v2.0, feb 2009) (yet another, but fast) Circulent Matrix Author: Jos Aldahiyat, Husam

Wow.

05 Feb 2009 CIRCULANT (v2.0, feb 2009) (yet another, but fast) Circulent Matrix Author: Jos D'Errico, John

Efficient, well written, clean code. Excellent help, examples. Appropriate error checks. It offers either form of circulant matrix, with the proper choice of default.

03 Feb 2009 NDLINSPACE (v1.1, feb 2008) Generalized LINSPACE: linearly spaced values between mutliple points Author: Jos AMBROISE, Steeve

I tried to compare this function to linspaceNDim with this code:

clear
a=rand(20,30,5,10,19,4);
b = rand(size(a));
N = 5;

tic, c1 = linspaceNDim(a, b, N);toc
clear c1

tic, c2 = ndlinspace(a, b, N);toc

I find that linspaceNDim is 20 times faster then ndlinspace.

Steeve.

22 Jan 2009 CATSTRUCT Concatenate structures (v2.2, oct 2008). Author: Jos Jeremy

Nice work, just one comment:
I just noticed that when merging two structures, the fact that any dissimilar fields in the FIRST level are merged, but dissimilarities in subsequent levels are lost: e.g.

s1.a = 1;
s1.b = 2;

s2.a = 101;

s3 = catstruct(s1,s2) gives s3.a = 101, s3.b = 2.
But

s1.A.a = 1;
s1.A.b = 2;

s2.A.a = 101;

gives s3.A = a : 101.
i.e. we lose field b. I kind of understand the logic, i.e. that it is now field A that is being overwritten by a new field A, so that a depth=1 merge has occurred, but for anyone looking to do a true merge-style operation, this means needing to loop though each level... any plans to change this?

04 Jan 2009 STOPLOOP (v1.0, jun 2008) Shows stop button to interrupt loops Author: Jos Mike

Relax, have a home brew. Free country with Free opinions to agree/dissagree with.. All problems are hard problems until they are solved. Thanks for the submission!

28 Dec 2008 STOPLOOP (v1.0, jun 2008) Shows stop button to interrupt loops Author: Jos Khurram

It was very useful to me. Thanks Jos

20 Dec 2008 YESNO let user choose between yes or no Author: Jos Eaton, Kenneth

@Marco,

The utility of this program should be very clear. I don't know why you are unable to understand it. This function allows you to pause a running program to wait for a yes ('y' press) or no ('n' press) keyboard input from the user. The example Jos gives in his description shows one possible use for it: the piece of code above generates a random number every time the user chooses 'y', and stops when they choose 'n'.

Your comment makes absolutely no sense. Yet again, it appears that you have somehow missed the point and are trying to punish the author with a bad rating even though it is you who has misinterpreted things. Your mention of a "half instant" and a "mechanic instant" is gibberish. Your review is quite poor.

20 Dec 2008 YESNO let user choose between yes or no Author: Jos boyer, alain

20 Dec 2008 YESNO let user choose between yes or no Author: Jos Poor, V.

20 Dec 2008 YESNO let user choose between yes or no Author: Jos P, M

While loop is a wait for a keypress and I have two ways: if the selection is y=yes then break, if the selection is n=no then break. It is a double possible input equal at the same output (break); 2=1. This is the while loop. There is other. If my input is been “y” then isyes=1 and if is been “n” then isyes=0; I write yes and it is yes, I write no and it is no, in both cases break to quit wait-loop. Conclusion: yes=yes and no=no with yes=no because there is break. One (yes=yes) and one (no=no) with one=one (yes=no) because there is break. This is half simulation of the mechanic instant (the inanimated instant, possible because exist users): break is the half, the stopper, the reference of the half-instant and I can choose the positive or I can choose the negative; in the first case is a positive instant (in the half) and in the second case is a negative instant (in the half).
I’m writing the program with my style and with addition of the other half instant:
yn=input(‘to select y=yes or n=no ...’); --> break, yes or no to go forward
if yn==’y’,
y=1; --> first case
n=0; --> there isn’t in the program
elseif yn==’n’,
y=0; --> second case
n=1; --> there isn’t in the program
end
Can you help me to understand the meaning of your function?
I’m searching the utility of the program. What is the utility of half instant?
I’ve an idea but I would listen to you.
Regards

19 Dec 2008 CountMember Count members. Author: Jos sherer, Pete

Excellent. It could be better if you can also return the logical index as a second output.

11 Dec 2008 CATSTRUCT Concatenate structures (v2.2, oct 2008). Author: Jos Daniel

21 Nov 2008 HERRORBAR Horizontal errorbar plot. Author: Jos Hansen, Kim

PLEASE PLEASE Help

I am almost about to give up. How do I remove those crappy connection lines that herrorbar produces. In the normal errorbar i can just write

errorbar(x,y,e,'LineStyle','none')

where e offcourse is the error on the y values which in my case should be added to the x values. So I really want the command to be like this

herrorbar(x,y,e,'LineStyle','none')

but that does not work.
Please help

14 Nov 2008 ALLCOMB All combinations of input Author: Jos fabio

easy things are always the best! Great!

06 Nov 2008 RANDPERMBREAK (v1.1, nov 2008) randomize the order of elements within sections of a vector Author: Jos Jos

In v1.0 the last example should read:
T = ['Uijt!jt!bo!jmmvtusbujpo!pg!uif!fggfdu!pg!qfsnvujoh!mfuuf' ...
           'st!xjuijo!xpset!' char(14) '!fydfqu!gps!uif!gjstu!boe!mbtu!mfuufs!/' ...
           '!Ep!zpv!uijol!uiftf!tfoufodft!' char(14) '!bsf!tujmm!sfbebcmf!@'] ;
      i = find(T == 33) ;
      r = randpermbreak(numel(T),[1 i-1 i i+1 numel(T)],'fixed') ;
      char(T(r)-1)

27 Oct 2008 PERMPOS all possible permutations of M values in N positions Author: Jos Jos

Amanda, could you contact me directly? See any of my recent submissions for an address. Jos

 

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