Interpolation of scatter data of a matrix

2 views (last 30 days)
Say i have a 1*5 matrix known as throttle is [1 2 3 4 5], I have another matrix of torque of 5*5. the corresponding elements for the 6*5 matrix is [10 ;12 ;15; 16; 14 20; 24; 25; 27; 22 30; 32; 34; 35; 36 40; 41; 42 ;46 ;42 50; 55; 54; 53; 52 ].
throttle 1 2 3 4 5
torque 10 20 30 40 50
12 24 32 41 55
15 25 34 42 54
16 27 35 46 53
14 22 36 42 52
i have an another matrix of 7*5 of torque data say [10.2 ;12.3 ;15.4; 16.2;14.7 20.1; 24.5; 25.2; 27.5; 22.4 30.2; 32.4; 34.5; 35.2; 36.8 40.2; 41.4; 42.3 ;46.1 ;42.8 50.2; 55.3; 54.2; 53.7; 52.8 ]. i want to get corresponding throttle positions for corresponding torque steps. through interpolation function how to do this?

Accepted Answer

KSSV
KSSV on 30 Jan 2019
Edited: KSSV on 30 Jan 2019
Read about interp2
throttle =[ 1 2 3 4 5] ;
torque =[ 10 20 30 40 50
12 24 32 41 55
15 25 34 42 54
16 27 35 46 53
14 22 36 42 52] ;
torquei = [10.2 12.3 15.4 16.2 14.7 ; 20.1 24.5 25.2 27.5 22.4 ; 30.2 32.4 34.5 35.2 36.8 ;
40.2 41.4 42.3 46.1 42.8 ; 50.2 55.3 54.2 53.7 52.8 ] ;
throttlei = zeros(5,5) ;
for i = 1:5
throttlei(i,:) = interp1(torque(i,:),throttle,torquei(i,:)) ;
end
If you have Y coordinate also, you can use interp2
  1 Comment
Debanjan Maity
Debanjan Maity on 30 Jan 2019
say my torquei is a column matrix of 8*1. the matrix is [10.2; 20.3; 30.4; 32.6;40.2;22;18;33]. i want to get corresponding throttles for the torque steps. My code is showing error.1.jpg

Sign in to comment.

More Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!