Adding points to interpolant
    5 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Tintin Milou
 el 31 de Mayo de 2023
  
    
    
    
    
    Respondida: Srivardhan
      
 el 1 de Jun. de 2023
            Hello,
Suppose I have a scatter of points and have used scatteredInterpolant to get an interpolant F. 
Now, I want to add one more point to my scatter and update my interpolant F. Is simply calling scatteredInterpolant the fastest way or is there a way to update F in a more efficient way? It seems like a waste of time to reconstruct the interpolant from scratch given that I only want to add one more point. 
Thank you!  
0 comentarios
Respuesta aceptada
  Srivardhan
      
 el 1 de Jun. de 2023
        Hi Tintin, 
As per my understanding, you would like to add the points to existing Interpolant without creating a new Interpolant using “scatteredinterpolant” function.
Interpolant has two properties called Points and Values. Points is a vector contains the coordinates of sample points, and Values is also a vector that contains the sample values associated with Points vector coordinates. By using Points and Values vectors, you can add points to the existing Interpolant . 
Here is the code to add the points to existing Interpolant, you can check:
X = randi([-10,10],10,1);
Y = randi([-10,10],10,1);
Z = X + Y;
F = scatteredInterpolant(X,Y,Z)
F.Values(end+1) = 4
F.Points(end+1,:) = [2,2];
F
For further reference, please check the following link to know more about “scatteredinterpolant” function.
I hope this resolves the issue you were facing. 
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Interpolation en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

