Search Comments and Ratings

go

Comments and Ratings

   
Date File Comment by Comment Rating
31 Jul 2010 Arduino Target Develop applications for the Arduino platform using SimulinkĀ®. Author: Doug Eastman gomez, marco

I have the same error:"Error in S-Function", but how compile for 64 bits?...i don't know.

Thank you

31 Jul 2010 nsumk Returns a listing of n-tuples of non-negative integers adding up to k Author: Peter Cotton D'Errico, John

No! There is no reason to cause help to fail, forcing the user to use type instead! I never suggested that. When did I ever recommend an idea like that?

All that you need to do to enable lookfor is to include ONE MORE LINE, at the very beginning of the help block!!!!!!!!!!! The comment block should be contiguous, to enable both help and lookfor.

Look at EVERY MATLAB function that MathWorks provides. Read the help for lookfor,

As far as the use of your function goes and the help itself, all that I have asked is that you make the help clear, explaining what it does, rather than forcing the user to divine exactly what you mean when you say the word "tuple". While you may feel this is obvious, other users will not have the same background. So make your help clear. Is this really difficult to do? Tell the user what happens when they pass in a vector, don't make them guess that the only piece of information that you take from that vector is the length of the blasted thing!!!!!!!

Good code is friendly to the user. Bad code makes the user make wild, unsupported guesses, and then returns arbitrary results when they lack the ability to read the mind of the author.

31 Jul 2010 Simulink programmable pulse generator A pulse generator with amplitude, pulse width, and pulse period inputs. Author: Dustin rai, upma

Hiii
how to change bit rate of gennerated pulse....like when i want to generate pulse of 10kbit/sec den how can I do......plz suggest me

31 Jul 2010 Spectrum Scope Easily compute and display a real-time FFT. Author: Scott Hirsch Patel, Bhavik

Hey guys how does this file work ? I have a file which is split in to two columns time with pressure I want to do the FFT on this within Matlab but im a little lost. Anyone guide me in the right direction please?

Kind Regards,
Bhavik

31 Jul 2010 Calculation of distances from a given set of points to a set of segments A fully vectorised calculation of distances from a given set of points to a set of segments. Author: Andrei Bejan Steve

This is exactly what I needed. Thanks very much, that's a great contribution.

31 Jul 2010 N-dimensional histogram Compute n-dimensional histogram Author: Bruno Luong Fripp, Matthias

About plotting the results:

Jaclyn, if you just want bars plotted for the pairwise densities of two variables (i.e., a plot with x and y axes corresponding to values of your variables, and vertical bars on the x,y grid, corresponding to the counts for each 2D bin), you can get that with hist3().

Will, if you want to plot weights for 3 variables as varying sizes of bubbles on an x,y,z grid, you can do something like this:

% get the histogram
[count edges mid loc] = histcn(vals);

% make a grid for plotting
[X Y Z]=ndgrid(edges{1}, edges{2}, edges{3});
X=X(:); Y=Y(:); Z=Z(:);

% calculate sizes so the most dense cell gets a value of 100
% also convert from volume to "area" (as if drawing a sphere with
% the right volume and cross-sectional area s)
s_scale = 100/(max(count(:))^(2/3));
s = count(:).^(2/3) * s_scale;
% convert any zeros to small numbers for scatter3
s(s==0)=realmin;

% plot the densities
fh=figure();
set(fh, 'Renderer', 'OpenGL'); % faster drawing
scatter3(X, Y, Z, s, 'filled');

31 Jul 2010 Toolbox Fast Marching A toolbox for the computation of the Fast Marching algorithm in 2D and 3D. Author: Gabriel Peyre jinguo, wang

Thank you for your share!But there is a error that mex/perform_front_propagation_2d.cpp' not found,when i run compile_mex file.So i wanna get your help! Thanks!

31 Jul 2010 Toolbox Fast Marching A toolbox for the computation of the Fast Marching algorithm in 2D and 3D. Author: Gabriel Peyre jinguo, wang

31 Jul 2010 ploterr plots data with x and/or y error bars and supports logarithmic scaling for both axes. Author: Felix Zoergiebel Boris

Hi, can someone give an example how more then 1 line can be plotted together?
for example: x = 0:15;
      x1 = 5:20;
      x2 = 10:25;
      y =exp(-x).*(rand(1,16)*0.9+0.1);
      y1=exp(-x).*(rand(1,16)*0.7+0.3);
      y2=exp(-x).*(rand(1,16)*0.2+0.5);
      
I could not figure out how to do it by ploterr([x1 x2 ... xn],[y1 y2 ... yn],....) so I tried it the way as below, but can not get the legend of all entries.
     
      h =ploterr(x,y,0.3,{exp(-x)*0.1 exp(-x)},'r.','logx','hhxy',0.5)
      set(h(2),'Color','b'), set(h(3),'Color','b')
        hold all;
      h =ploterr(x1,y1,0.4,{exp(-x)*0.2 exp(-x)},'k.','logx','hhxy',0.4)
      set(h(2),'Color','k'), set(h(2),'Color','k')
      h =ploterr(x2,y2,0.5,{exp(-x)*0.3 exp(-x)},'b.','logx','hhxy',0.3)
      set(h(2),'Color','r'), set(h(3),'Color','r')
      legend(h,{'data' 'error x' 'error y'})

Thanks.

Boris

31 Jul 2010 Optical Character Recognition (OCR) The aim of OCR is to classify optical patterns corresponding to alphanumeric or other characters. Author: Diego Orlando Barragan Guerrero sekhar, mrudula

hi sir, ur work is really good.
i am too trying to implement the same as a part of my academics, so like to know more about the subject. can u please help me ?
i did like to know about the different steps involved in character recognition. can u provide me with some pdf documents which i can depend to complete my project.

30 Jul 2010 nsumk Returns a listing of n-tuples of non-negative integers adding up to k Author: Peter Cotton Cotton, Peter

Dear John,

I see where you got the idea this was supposed to be the same as nchoosek (because it uses the same convention for ordering tuples and has the same limitations). However, this would seem to be in contradiction with the first English line of help, where that elusive definition is hiding. There is also a definition for the vector case:

"listing of n-tuples of non-negative integers adding up to k"

and miraculously, this function performs accordingly:

x = nsumk(1:5,2) returns a list of 5-tuples of non-negative integers, as advertised, 5 being the length of 1:5. The first three happen to be:

     0 0 0 0 2
     0 0 0 1 1
     0 0 0 2 0

All rows sum to 2, also as advertised. (Incidentally it may be possible to create a vector of length 5 in fewer characters than 1:5 but I leave that to others). The overloading is the same as nchoosek. If you want to produce lists I know of no shorter means than

> nchoosek(1:5,2)
     1 2
     1 3
     1 4
     1 5
     2 3
     2 4
     2 5
     3 4
     3 5
     4 5

All that said, I agree with you that the usage "help" is inconsistent and/or foreign. To be precise (in the same style) I could write

x: nchoosek(k+length(n)-1,length(n)-1) x length(n) - listing of non-negative integers with rows summing to k

but I suggest that you would prefer me to break my practice of including the function signature (thereby forcing users to "type nsumk" rather than "help nsumk" as per Mathworks tradition, but allowing help in the style of nchoosek), or not tell the user the dimensions of the output (another fine tradition).

Here then is my suggestion:

function x = nsumk(v,k)
% NSUMK Number or listing of non-negative integer n-tuples summing to k
% NSUMK(N,K) where N and K are positive integers returns nchoosek(K+N-1,N-1)
% This is the number of ordered N-tuples of non-negative integers summing to K
%
% NSUMK(V,K) where V is any vector of length n produces a matrix with
% nchoosek(K+N-1,N-1) rows and n columns. Each row comprises
% non-negative integers summing to k. The ordering of rows follows the
% same convention as NCHOOSEK, which is undocumented by Mathworks but with some
% reliability appears to be lexicographic. The reverse of this presumed ordering
% is a natural way to list coefficients of polynomials in N variables of degree K.
% As per nchoosek, this syntax is only practical for situations where N is
% less than about 15.

if isscalar(v),
    x = nchoosek(k+v-1,v-1);
elseif isvector(v)
    n = length(v);
    nDividers = n-1;
    nSpots = k+nDividers;
    m = nchoosek(k+n-1,n-1);
    dividers = [zeros(m,1),nchoosek((1:nSpots)',nDividers),ones(m,1)*(nSpots+1)];
    x = diff(dividers,1,2)-1;
else
    error('nsumk anticipates scalar or vector v');
end

You like ?

Kind Regards,

Peter

30 Jul 2010 nsumk Returns a listing of n-tuples of non-negative integers adding up to k Author: Peter Cotton D'Errico, John

I am NOT proposing anything. I merely tried to read the help for your own function, then tried to convince you that your code needs documentation when used in a way that your help says is possible. Here are a couple of lines, written by you!

% Usage 2: x = nsumk(1:5,2)
%
% n: vector

Exactly how should your code work? What is the behavior of your code when it is passed a vector input for n? You need to define that. And to this point, I have seen no definition, no explanation. I've seen multiple references to nchoosek, that your code is related in some way to nchoosek. Therefore I assumed that when I call it in a way that I would call nchoosek, I might get a similar result. If this is false, then you need to document your own code properly. I am not suggesting any new functionality for this code. Merely that you document the EXISTING functionality so that a person who might want to use it can do so.

30 Jul 2010 nsumk Returns a listing of n-tuples of non-negative integers adding up to k Author: Peter Cotton Cotton, Peter

Dearest John,

    Thank you once again for your continued interest in this important matter.

    And thank you for the idea of modifying the overloading of the first input argument. However clearly I might comment the help code for this new and improved function per you proposal, I fear that it may remain somewhat confusing. Your suggestion amounts to the following:

   Usage 1: nsumk(n,k) returns the # of n-tuples summing to k
   Usage 2: nsumk(v,k) where v is length (n+1) returns list of n-tuples summing to k

whereas at present:

   Usage 1: nsumk(n,k) returns the # of n-tuples summing to k
   Usage 2: nsumk(v,k) where v is length n, returns a list of n-tuples summing to k

I agree that the overloading is a little awkward either way but I don't think the former is an improvement over the latter.

I fear we may have strayed however in our joint undertaking to improve the help for this vital function. Perhaps we should consider more precisely which part of "n-tuples of non-negative integers adding up to k" you find unclear, and why it is that we should disqualify those deeply offensive numbers greater than n, as per your example of 4 and 5 above? I fear the vast community of users will be greatly disappointed should they struggle through my hopelessly unclear description only to find that nsumk(1:2,5) returns the empty set.

Kind regards,

Peter

30 Jul 2010 SLM - Shape Language Modeling Least squares spline modeling using shape primitives Author: John D'Errico Avital, Royi

John, Thank you for your response.
I will cite as you advised me to.

I'll try to have a look at De Boor's book.
I just wanted the solid math behind the tool.
Hopefully I'll get from there.

One day, If you do write an article or notes about it I'd be happy to read and learn.

Thank you.

30 Jul 2010 subfigure Create a figure within a grid-based layout. Like subplot, but for figures. Author: Steve Hoelzer Boardman, Ian

This does not create an array of figures, but merely an array of axes. Just run get(get(subfigure(m,n),'Children'),'Type')
What I was hoping was to get a set of figure handles. Is that not possible in Matlab? Is there an easy way to position and scale all the children of a given figure to a new figure, with all their relative positions preserved?

30 Jul 2010 nsumk Returns a listing of n-tuples of non-negative integers adding up to k Author: Peter Cotton D'Errico, John

Yes, but if you will argue that this code is in any way consistent with nchoosek, then it must be so. In the example I posed,

nsumk(1:3,5)

yields numbers that are not in that set! Zero is not in the set. 4 is not in the set. 5 is not in the set.

So clearly your code is not consistent with nchoosek, despite multiple statements that it is. You say what your code does and doe not require, but no place do you state that in the help. If you do not state what your code does, then how will anybody else ever find it of value?

Next, if you have lost the code before, then this is even a better reason to enable lookfor. Use an H1 line. Use a help style that at least tries to follow the style of help that the MathWorks uses. This makes your code more useful to others. Otherwise, it is of no use to anybody but you.

30 Jul 2010 Handling Large Data Sets Efficiently in MATLAB Handling Large Data Sets Efficiently in MATLABĀ® Author: Stuart McGarrity Nouyed, Naved

Here's the updated link to the webinar mentioned above:

http://www.mathworks.com/company/events/webinars/wbnr30435.html?id=30435&p1=32517&p2=32518

30 Jul 2010 nsumk Returns a listing of n-tuples of non-negative integers adding up to k Author: Peter Cotton Cotton, Peter

John,

   Thanks for the extremely speedy feedback.

   Zero is a non-negative integer, and we do not require the integers here to be less than the number of variables. In generally accepted parlance the term tuple usually means an ordered list of elements, so I think the intent is clear. Sorry for my brevity. FYI it is a natural way to list polynomials in n variables of degree precisely k.

    As is evident from the code this is little more than syntactic sugar for nchoosek, but since I've lost it once before I'm sticking it here!

Peter

30 Jul 2010 WiMAX 802.16e Physical Layer WiMAX Physical Layer Implementation in Simulink Author: Muhammad Nadeem Khan Kevin

can you please send me the documentation if that is still possible.
kmj442@gmail.com
Thanks

30 Jul 2010 nsumk Returns a listing of n-tuples of non-negative integers adding up to k Author: Peter Cotton D'Errico, John

Also, the help needs to be explicit about whether the pair of integers {2,3} is distinct from the pair {3,2}. I would argue that is an extremely important distinction. This code seems to count them both.

30 Jul 2010 nsumk Returns a listing of n-tuples of non-negative integers adding up to k Author: Peter Cotton D'Errico, John

I would first point out that my own partitions.m solves exactly this problem, as well as a flexible variety of related problems.

http://www.mathworks.com/matlabcentral/fileexchange/12009

A quick test shows there to be a problem here though. Use nsumk to find all sums of tuples of the integers 1:3, that sums to 5. The help seems to indicate that this is possible, using the following call:

nsumk(1:3,5)
ans =
     0 0 5
     0 1 4
     0 2 3
     0 3 2
     0 4 1
     0 5 0
     1 0 4
     1 1 3
     1 2 2
     1 3 1
     1 4 0
     2 0 3
     2 1 2
     2 2 1
     2 3 0
     3 0 2
     3 1 1
     3 2 0
     4 0 1
     4 1 0
     5 0 0

But clearly, that interpretation seems to fail, since nsumk uses 4 and 5 in those sums.

The help here seems reasonable, although it lacks an H1 line. AN H1 line is valuable when next month or next year, you simply cannot recall the name of that blasted function you wrote or downloaded long ago. It enables the function lookfor, which uses the very first line of your help. By putting a single line of intelligent description there, you can now use lookfor to do a keyword search of those H1 lines.

There are no error checks in this code. Of course, how can you check for errors when the help is not quite clear about what the arguments mean?

30 Jul 2010 A Fast Image Segmentation using Delaunay Triangulation A fully automated process that does not require initial estimate of number of clusters. Author: Abbas Cheddad Samir

Yet another brilliant piece of code from you Abbas! Thank you very much for posting that.

30 Jul 2010 A Fast Image Segmentation using Delaunay Triangulation A fully automated process that does not require initial estimate of number of clusters. Author: Abbas Cheddad Samir

30 Jul 2010 Kalman Filter Application two factor CIR Estimates the parameters of the two factor CIR model on the UK German, and US term structures. Author: Nils Delava Yu, Qinyu

Hi Hils, could you tell me how did you decide the initial parameter value as input ? Thank you very much!

30 Jul 2010 Using Doxygen with Matlab Extracts automatically comments from your Matlab .m files using Doxygen to generate documentation Author: Fabrice McDonnell, Matt

Very nice tool - many thanks!
I found I had to use Doxygen 1.6.1, not 1.7.1 (latest).
I see from http://stackoverflow.com/questions/2701671/problem-with-input-filter-using-doxygen-1-6-3-on-windows-xp
you've seen something similar before.

30 Jul 2010 SLM - Shape Language Modeling Least squares spline modeling using shape primitives Author: John D'Errico D'Errico, John

I wish I had written a paper on this topic years ago when I wrote the first version of this tool. I did not do so then, although I have given a few talks on the underlying modeling philosophy of these tools.

The basic idea is simply that of a least squares spline, augmented by a smoothness penalty like a smoothing spline. The smoothness penalty solves the problem of arbitrary (poor) knot selection in many cases.

General least squares splines are covered in depth in the literature, as are smoothing splines. For these fundamental ideas, de Boor is of course the classic reference, a book worth reading for any user of splines.

What the SLM tools add though is something that I've never really seen written about in the literature. This is the idea that intelligently chosen constraints on the curve shape can act as a strong, useful regularizer on your result. They allow you to build your own knowledge about a system into the model, using a simple vocabulary to describe the desired shape of that curve.

I wrote these tools after some years of seeing people using strange nonlinear regression models to fit curves, just because they needed a curve with a given shape. So the user picks some nonlinear sigmoidal form, a Gaussian, etc., for no better reason than that it fits some fundamental desired shape. And of course, nonlinear regression has its own problems, like poor starting values, lack of convergence, etc. Worse, the user finds that the curve shape they chose is not really the correct shape, so they end up with significant lack of fit. Once a viable tool becomes available to fit those curves, I find that far fewer people end up using nonlinear regression models for the wrong reasons.

There are a couple of files that discuss some of these ideas "slm_tutorial.html" and "shape prescriptive modeling.rtf" in the zip file, but that is all I can offer. We also suggested a citation format for tools from the file exchange, if you do need an explicit reference. You can find our recommendations here:

http://matlabwiki.mathworks.com/Citing_Files_from_the_File_Exchange

30 Jul 2010 pa-wavplay Play and record multi-channel audio using either an ASIO, DirectSound, or Windows multimedia audio d Author: Matt Frear Gauthier, Philippe-Aubert

Following my previous comment, here is my recent advice. On win64 bits, I have not been able to run pa_wavplay in Matlab 64 bits. Using Matlab 32 bits in Win 7 64 bits, I have been able to run pa_wavplay without any problem with a 96-channel system made from MOTU sound cards.

30 Jul 2010 Wind_rose Wind rose of direction and intensity Author: M MA LEE, YJ

% Input data SHOULD be meteological wind data coming from
% ie. 0 deg=North, 90 deg=East, 180 deg=South, & 270 deg=West
% if 'dtype' is 'ocean'; to do coversion mod(-90-D,360) and
% to plot wind direction from meteolocal convention
% (coming from) to oceanographci convention (going to)
% if 'dtype' is 'meteo'; to do coversion mod(90-D,360) and
% to plot wind direction in meteolocal convention
% In case, input data are in oceanographic convention. Without 'dtype'
% option, wind_rose will plot wind going to. It is same results when
% 'dtype' is 'ocean' using wind data coming from (meteological convention)

30 Jul 2010 SLM - Shape Language Modeling Least squares spline modeling using shape primitives Author: John D'Errico Avital, Royi

Is there any article which could be used as reference to this kind of fitting?
I'd like to use this tool in my project and would like to back it up with some background info.

Thanks for this amazing tool.

30 Jul 2010 Wavefront OBJ toolbox Read and Write Wavefront OBJ geometry and MTL files Author: Dirk-Jan Kroon wan, Jun

it's great work! thanks

30 Jul 2010 ICP variants An implementation of various ICP (iterative closest point) features. Author: Jakob Wilm H, Michael

Looks very good, but I can't get icp.m to run as I think it is missing the rms_error function. Am I doing something wrong?

30 Jul 2010 Simulink Signal Viewing using Event Listeners and a MATLAB UI. This demo shows how to use block listeners to view model signals in a MATLAB user interface. Author: Phil Goddard z, zanna

what about "the old metod" s function??

30 Jul 2010 Surface Fitting using gridfit Model 2-d surfaces from scattered data Author: John D'Errico Chapman, Adam

the new setting "'smoothness',[xsmooth ysmooth]" is a Godsend. Many Thanks

30 Jul 2010 uneven Display unevenly distributed data in 2-D and 3-D as ordinary colour-coded, regularly spaced data. Author: Oyvind Breivik Guillaume

Hi, do you have some simple example about how to use it ?

30 Jul 2010 OpenSURF SURF (Speeded Up Robust Features) image feature point detection / matching, as in SIFT Author: Dirk-Jan Kroon Kroon, Dirk-Jan

*Peter
Thank you for your comment. With the default option setting, the minimum size of the image is 256 x 256.
If you reduce the octaves you can use a smaller size, minsize = 2^Options.octaves*8 .
I will build a check in a new version.

30 Jul 2010 rilt Regularized Inverse Laplace Transform Author: Iari-Gabriel Marino H, L

The program is great and lets the user to avoid the trouble of dealing with the original Fortran CONTIN program. The program works great, although I have just a couple comments:
- The "s" array fed to rilt is actually a tau array (s = 1/tau).
- "rilt.m" should be called "rlm.m" because it is actually the forward transform by the majority of definitions I've ever seen. L[f(t)] = F(s) = F(1/tau) is the forward transform.

That said, I want to say thank-you to the programmer. This routine has helped me out with an aspect of my thesis.

29 Jul 2010 TRUTH TABLE Creates a Logical Truth Table Matrix for 'N' Input Variables. Author: Abhishek Chakraborty Jamleh, Hani

29 Jul 2010 Theme from Super Mario Brothers Song plays the Super Mario Brothers theme song. Author: James Humes Robert

29 Jul 2010 Inpaint over missing data in N-D arrays Y = INPAINTN(X) replaces the missing data in X by extra/interpolating the non-missing elements. Author: Damien Garcia Leonardo

Very useful, works nicely. The only issue is that a couple of additional functions (dctn and idctn) have to be downloaded from another site for this to work

29 Jul 2010 OpenSURF SURF (Speeded Up Robust Features) image feature point detection / matching, as in SIFT Author: Dirk-Jan Kroon Peter

Hello,

Toolbox looks nice, but

feats = openSurf(randn(49,285));

errors:

??? Index exceeds matrix dimensions.

Error in ==> FastHessian_isExtremum>FastHessian_getResponse at 44
an=a.responses(fix(scale*row) * a.width + fix(scale*column)+1);

Error in ==> FastHessian_isExtremum at 25
candidate = FastHessian_getResponse(m,r,c,t);

Any ideas?

29 Jul 2010 Demonstration of Astar (A*) Pathfinding algorithm Astar (A*) Author: Bob Sturm Graven, TheCount

I was playing with the code and I think that the g part of the Astar equation (f=g+h) is missing. I inputted my own state space for the algorithm to traverse and it went 7 spaces more than it needed to to reach its goal. I added a crude form of g and it found the optimal path I was looking for in my example. Other than that I like this GUI it looks really nice.

29 Jul 2010 3D Polar Plot Plots 3D polar data with axes. Author: J De Freitas Knight, BD

Cool. How can I set meshscale independently for rho and theta?

29 Jul 2010 Simulink LED Make a status display of signal in Simulink. Author: Po Hu Dillon, Martin

Awesome, this is exactly what I was looking for. Thanks!

29 Jul 2010 OpenSURF SURF (Speeded Up Robust Features) image feature point detection / matching, as in SIFT Author: Dirk-Jan Kroon Kroon, Dirk-Jan

*Petter
I have optimized the Matlab code, replacing all for-loops by 1D and 2D indexing. This version takes less then 1 sec for the example picture.
The original C# version is only 2x as fast for large images.
Of course a mex file is faster, but this Matlab code is easier to study, debug, and doesn't need external libraries or compilers.

(Tomorrow a new version wil be online were I fixed a small bug in the image display function)

29 Jul 2010 estimateRigidTransform estimate the rigid transformation between two sets of 3D point clouds, given a set of point matches Author: Babak Taati Taati, Babak

Thanks Janti. You're correct. I fixed it.

29 Jul 2010 Maximum Drawdown Maximum relative drawdown of time-series data Author: Andreas Bonelli Licona, Andres

If you are really interested in the downside risk Steiner's version is the best. Then you have more insight about the tail. This is very important when looking at regimes.

29 Jul 2010 Cornish-Fisher VaR Returns the Cornish-Fisher Expansion Valut at Risk. (Up to 4th moment) Author: Tal Shir Licona, Andres

29 Jul 2010 multimodality non-rigid demon algorithm image registration non-rigid 2D and 3D image registration with demon (fluid) algorithm, extended with modality transf. Author: Dirk-Jan Kroon Lu, Cheng

What a perfect work~~~ I try it and foud that the gradient of the image is calculated as [My,Mx]=gradient(M); But why you want to inverse the x and y? Since normally we use [Mx,My]=gradient(M); Maybe it is related to your 'Movepixels' function?

Your implemntation is based on the additive Demons, do you have any idea to add a compositive Demons? How do we calculate the composition of fields in Matlab? Thanks.

29 Jul 2010 ROC curve compute a ROC curve Author: Giuseppe Cardillo Oshin, Segun

Hi, the code is very good. However, I encounter an error where the cut-off point is set, on line 186,

??? Attempted to access labels(7397); index out of bounds because numel(labels)=7396.

Error in ==> roc at 186
        co=labels(J); %Set the cut-off point

Is there a way to fix this?
Kind regards!

29 Jul 2010 ROC curve compute a ROC curve Author: Giuseppe Cardillo Oshin, Segun

Contact us at files@mathworks.com