plotting coordinates and fitting

8 vues (au cours des 30 derniers jours)
Ede gerlderlands
Ede gerlderlands le 5 Nov 2012
I have 3 coordinates which are (12,0.6},(50,0.8) and (145,0.4) and i have x values that range from 1 to 500 and I want to fit y values linearly for each of x's (1:500) based on the three y values I have. Any help in this regard is highly appreciated.

Réponse acceptée

Matt J
Matt J le 5 Nov 2012
Modifié(e) : Matt J le 5 Nov 2012
p=polyfit([12 50 145],[.6 .8 .4],1);
y=polyval(p,1:500);
  1 commentaire
Ede gerlderlands
Ede gerlderlands le 5 Nov 2012
Thanks for your help...

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Interpolation dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by