Borrar filtros
Borrar filtros

How can i generate a function using this points?

11 visualizaciones (últimos 30 días)
Mr. 206
Mr. 206 el 29 de Ag. de 2018
Comentada: Cesar Antonio Lopez Segura el 30 de Ag. de 2018
If i got x=[1,3,8,25,45,23]; and y=[25,24,13,69,25,75];
  4 comentarios
Adam
Adam el 29 de Ag. de 2018
There are an infinite number of functions that could take that one example input and give that output.
Mr. 206
Mr. 206 el 29 de Ag. de 2018
Okey for example if i want a polynomial function, can you help me?

Iniciar sesión para comentar.

Respuesta aceptada

Jan
Jan el 29 de Ag. de 2018
x = [1,3,8,25,45,23];
y = [25,24,13,69,25,75];
p = polyfit(x, y, 5)

Más respuestas (1)

Cesar Antonio Lopez Segura
Cesar Antonio Lopez Segura el 29 de Ag. de 2018
Hi Here the solution:
% Your cloud point
x=[1,3,8,25,45,23];
y=[25,24,13,69,25,75];
% calculate a new cloud point that contain the last one
xnew = [1, 1.5 ,3,6,8,25,32,45,31,23];
ynew = interp1( x,y, xnew,'pchip' );
% plot de new values
plot(x,y,'o');hold on;plot( xnew, ynew,'r' )
% polinomios
p = interp1( x,y,'pchip' );
  5 comentarios
Mr. 206
Mr. 206 el 30 de Ag. de 2018
If the x values are not monotonic, then is there any way to handle this?
Cesar Antonio Lopez Segura
Cesar Antonio Lopez Segura el 30 de Ag. de 2018
You can define x values in ascending order with sort.
Then you can order de y values.
[xtointerpol indx ] = sort(x);
ytointerpol = y(indx);

Iniciar sesión para comentar.

Categorías

Más información sobre Point Cloud Processing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by