File Comment by Comment
20 Dec 2013 curvspace Generate evenly spaced points along an existing curve in 2D or 3D. Francesca

### Francesca (view profile)

This function is very good! You solved me a very big problem! Thank you!

5
10 Aug 2013 curvspace Generate evenly spaced points along an existing curve in 2D or 3D. John D'Errico

### John D'Errico (view profile)

Not vectorized, and purely linear interpolation. Better is my own interparc, also here on the fex.

http://www.mathworks.com/matlabcentral/fileexchange/34874-interparc

For example, given 4 points around a circle, try this:

t = linspace(0,2*pi,5)';
xy = [cos(t),sin(t)];

tic,xyi = interparc(100,xy(:,1),xy(:,2),'lin');toc
Elapsed time is 0.001540 seconds.

tic,xyc = curvspace(xy,100);toc
Elapsed time is 0.004692 seconds.

So the unvectorized code is slower. And if we plot the points, we see a diamond results, thus connect the dots interpolation.

plot(xyc(:,1),xyc(:,2),'b-')

You can use interparc to get a nice smooth curve instead. Of course, it will be slower, since it is actually finding the true distance along the interpolated spline curve.

xyi = interparc(100,xy(:,1),xy(:,2),'cs');
plot(xyi(:,1),xyi(:,2),'b-')

The help is good enough, and I see plentiful internal comments, so well done there. The code is reasonable, although a bit loopy.

Comment only
10 Aug 2013 curvspace Generate evenly spaced points along an existing curve in 2D or 3D. ted p teng

### ted p teng (view profile)

5
16 Aug 2012 usercolormap usercolormap lets you create your own colormap in a simple way. Intensity scale can be respected. maryline bawedin

### maryline bawedin (view profile)

Problem with the intensity factor. Produce negative values inside the colormap.
Tried with the following example:
color1 = [1 1 0.7];
color2 = [1 0.8 0];
color3 = [1 0 0];
color4 = [0.4 0 0];
TestMap=usercolormap(color1,color2,color3,color4,1.2)

1
05 Apr 2012 SIMPGDSEARCH Multi-dimensional unconstrained nonlinear minimization using grid search + Simplex method. Nikki

### Nikki (view profile)

SETPROD can be found here http://www.mathworks.com/matlabcentral/fileexchange/5898. Many thanks to the author of simpgdsearch. It is really useful. Cheers!

Comment only
31 Jan 2012 curvspace Generate evenly spaced points along an existing curve in 2D or 3D. TCH

### TCH (view profile)

great job. I have implemented an equivalent function in the following link, :-.
http://www.mathworks.com/matlabcentral/fileexchange/34796-arbitrary-equal-division-function
purely could be a reference.

5
21 Jul 2011 SIMPGDSEARCH Multi-dimensional unconstrained nonlinear minimization using grid search + Simplex method. Saad

It seems that Matlab doesnt recognize setprod. Anyone has an updated code? Thanks a lot

Best

S

Comment only
22 Apr 2011 curvspace Generate evenly spaced points along an existing curve in 2D or 3D. Erhong

### Erhong (view profile)

5
08 Jan 2009 curvspace Generate evenly spaced points along an existing curve in 2D or 3D. Andrea Tagliasacchi

### Andrea Tagliasacchi (view profile)

thanks a lot, I didn't want to lose time re-implementing it!

5
26 Feb 2008 usercolormap usercolormap lets you create your own colormap in a simple way. Intensity scale can be respected. Fred De Masi

Great! Cheers!

5
17 Jan 2007 curvspace Generate evenly spaced points along an existing curve in 2D or 3D. Sven Mensing

Thank you for your excellent function. If you replace the distance by

function l = distance(x,y)
l = sqrt(sum((x-y).^2,2));

and calculate the distance between the points as follows:

dist_bet_pts = distance ( p(1:(length(p)-1),:), p(2:length(p),:));

you can increase the speed of curvspace by 300%.

Thanks again

Sven Mensing

5
12 Dec 2006 usercolormap usercolormap lets you create your own colormap in a simple way. Intensity scale can be respected. Matthias Moosmann

Perfect! Exactly what I was looking for!
Thanks!

5
09 Nov 2006 usercolormap usercolormap lets you create your own colormap in a simple way. Intensity scale can be respected. Carlos Adrián Vargas Aguilera

Great, and agree with Lupita (nice name)!

4
06 Nov 2006 usercolormap usercolormap lets you create your own colormap in a simple way. Intensity scale can be respected. Lupita Marquez

Good, i improved it by setting the input as a matriz with 3 columns, and with the size of the map as a varargin (default 256).

4
03 May 2006 SIMPGDSEARCH Multi-dimensional unconstrained nonlinear minimization using grid search + Simplex method. Ramin Radmanesh

The execution is terminated by the following error message:

??? Error using ==> eval
Undefined command/function 'setprod'.

Error in ==> simpgdsearch at 64
eval(['model = setprod(' str ');']);

Comment only
25 Mar 2006 curvspace Generate evenly spaced points along an existing curve in 2D or 3D. Daniel Daniel

Works Great! This is an incredibly useful tool. Unlike Matlab's interp functions the X-data does not have to be distint.

Thankyou for this handy function.

5
03 Feb 2006 curvspace Generate evenly spaced points along an existing curve in 2D or 3D. Valer Jurcak

Works fine, thaks. Please make N input also as percentual legth.
if N < 1 % e.g. 0.1 make new point every 10% of totaldist.
N = N * totaldist;
end

Comment only
04 Dec 2005 planenormvec Calculate the normal vector of a plane in 3D that contains three points. Dumb Kid

I tried a simple example of finding normal to the x-y plane using p1(0,0,0) p2(1,0,0) p3(0,1,0). It gives me following error "Three points are badly placed."

2
22 Nov 2005 usercolormap usercolormap lets you create your own colormap in a simple way. Intensity scale can be respected. Tom Williams

Very useful, especially the intensity interpolation figure. How about including the ability to generate a colormap of arbitrary size?

5
11 Oct 2005 usercolormap usercolormap lets you create your own colormap in a simple way. Intensity scale can be respected. Megha Jain

The program was really good but what should i do to exploit its full functionality

5
18 May 2005 curvspace Generate evenly spaced points along an existing curve in 2D or 3D. meng mingyang

It's not as my imagination,but it illumined me .Thank you!

Comment only
18 May 2005 curvspace Generate evenly spaced points along an existing curve in 2D or 3D. meng mingyang

useful program! It's exact what I want!
Thank you very much!

5
11 Apr 2005 usercolormap usercolormap lets you create your own colormap in a simple way. Intensity scale can be respected. Pierre Tinard

5