Native Matlab boundary function not working, can someone run it please :)
8 views (last 30 days)
Show older comments
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.
The link to the function: http://www.mathworks.se/help/matlab/ref/boundary.html?searchHighlight=boundary
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 Comment
Accepted Answer
A Jenkins
on 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)
0 Comments
More Answers (1)
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!