[Scilab-users] LInear interpolation between 2 curves

Antoine Monmayrant antoine.monmayrant at laas.fr
Mon Sep 17 11:06:48 CEST 2012


On 17/09/2012 09:53, Carrico, Paul wrote:
> Dear all,
> Is it possible to make a linear interpolation between 2 curves ? note 
> the abscissa are not necessary exactly the same  ...
> In particular terms, I've a curve one at temperature X and another one 
> at température Y and I would like to have (and to plot) temperature at 
> temperature Z in-between X-Y ... (see attachment)
> I had a look in interp, interp1 and interpln but nothing sound useful 
> for me ... Am I wrong ?
> Thanks for any advice
> Paul
> --------------------------------------------------------------------------------
>
>
> Le présent mail et ses pièces jointes sont confidentiels et destinés à la personne ou aux personnes visée(s) ci-dessus. Si vous avez reçu cet e-mail par erreur, veuillez contacter immédiatement l'expéditeur et effacer le message de votre système. Toute divulgation, copie ou distribution de cet e-mail est strictement interdite.
>
> This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error, please contact the sender and delete the email from your system. If you are not the named addressee you should not disseminate, distribute or copy this email.
>
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
>
You should have a look at ndgrid and cshep2d.
Here is a bit a script we use to interpolate scattered data on a grid:

[xy,k]=unique([x,y],1);
x=x(k);
y=y(k);
z=z(k);

//Interpolation bicubique
tl_coef = cshep2d([x y z]);
// evaluation on a grid
m = 50;
X = linspace(min(x),max(x),m);
Y = linspace(min(y),max(y),m);
[xx,yy] = ndgrid(X,Y);
// interpolation bicubique pour intuiter les valeurs
Z = eval_cshep2d(xx,yy, tl_coef);


Cheers,

Antoine

-- 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++

  Antoine Monmayrant LAAS - CNRS
  7 avenue du Colonel Roche
  31077 TOULOUSE
  Cedex 4 FRANCE

  Tel:+33 5 61 33 64 59
  
  email : antoine.monmayrant at laas.fr
  permanent email : antoine.monmayrant at polytechnique.org

+++++++++++++++++++++++++++++++++++++++++++++++++++++++

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20120917/2a7fb2e2/attachment.htm>


More information about the users mailing list