Native Matlab boundary function not working, can someone run it please :)

6 vues (au cours des 30 derniers jours)
Norris
Norris le 3 Nov 2014
Commenté : Steven le 4 Mar 2016
Hi all, I am trying to find the boundary to a set of points and I found a function called 'boundary' but I get an error when I try to run it.
edit: I assume this is a native function because I cant tell if it belongs to specific toolbox.
According to the example in the help, this is the code that is given:
Create and plot a set of random 2-D points.
x = gallery('uniformdata',30,1,1);
y = gallery('uniformdata',30,1,10);
plot(x,y,'.')
xlim([-0.2 1.2])
ylim([-0.2 1.2])
Compute a boundary around the points using the default shrink factor.
k = boundary(x,y);
hold on;
plot(x(k),y(k));
When I try to run the above code (direct copy and paste from the document), I get this error:
Undefined function 'boundary' for input arguments of type 'double'.
To check if the function exists, I typed
help boundary
I get this
>> help boundary
--- help for piecewisedistribution/boundary ---
boundary Boundary between segments of piecewise distribution.
[P,Q]=boundary(OBJ) returns the boundary points between the segments
of the piecewise distribution defined by OBJ. P is a vector of the
probability values at each boundary. Q is a vector of the quantile
values at each boundary.
[P,Q]=boundary(OBJ,J) returns P and Q for the Jth boundary.
See also piecewisedistribution, piecewisedistribution/nsegments.
Reference page in Help browser
doc piecewisedistribution/boundary
I see that the help doc is for 2014a and I am on 2013a but the fact that it shows up when I type help boundary and it returns text is boggling. Doesnt this mean that the function is somewhere on my Matlab install?
I also asked a colleague to run it on her computer (2012a) and she gets the same errors.
Any ideas?
  1 commentaire
Steven
Steven le 4 Mar 2016
I get the same error on a 2015b version. I don't think it is working at all.

Connectez-vous pour commenter.

Réponse acceptée

A Jenkins
A Jenkins le 3 Nov 2014
Those are not the same boundary function, as you can see because the help descriptions are different.
The boundary you have installed is a method of the piecewisedistribution object, and thus must be called on an object of that class.
The help for that function shows the following example, which is probably not what you want:
t=trnd(3,100,1);
obj=paretotails(t,0.1,0.9);
[p,q]=boundary(obj)

Plus de réponses (1)

Norris
Norris le 3 Nov 2014
Ooops. totally missed that.
Yes. This nice function is only available on 2014b :(

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by