How to interpolate based on given column
Afficher commentaires plus anciens
Hi,
I have below array(double), and want to assign 50 for maximum value and 0 for minimum value, and for the rest of the values between maxima and minima interpolation.
0.2
0.8
1.0
1.3
0.8
2.3
4.9
10.0
0.2
5
2.3
8.7
10
In this case,
0.2 -->50
10.0 -->0
for rest of the values, to interpolate between 50& 0.
Réponse acceptée
Plus de réponses (1)
madhan ravi
le 7 Nov 2018
Modifié(e) : madhan ravi
le 7 Nov 2018
a=[0.2
0.8
1.0
1.3
0.8
2.3
4.9
10.0
0.2
5
2.3
8.7
10]
[~,x1]= max(a)
[~,x2]=min(a)
a(x1)=50
a(x2)=0
Interpolated_values=interp1(a,linspace(a(1),a(end))); %interpolated between 0 and 50
Catégories
En savoir plus sur Acquisition Using Image Acquisition Explorer dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!