Scatter data interpolation of a column matrix
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Debanjan Maity
am 30 Jan. 2019
Kommentiert: Andrei Bobrov
am 30 Jan. 2019
say I have two matrix
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
15 24 32 44 51] ;
I want to get throttle values at some specific torque position.
say the torque position points are [10.5;20.4;30.5;40.2;22.4;51.9]
How to do this with interpolation function, i am facing error during running the code
3 Kommentare
Akzeptierte Antwort
Andrei Bobrov
am 30 Jan. 2019
Bearbeitet: Andrei Bobrov
am 30 Jan. 2019
T = readtable('torque.xlsx','ReadV',0);
torquei = xlsread('torquei.xlsx');
throttle= [0 2.5 5 10 15 20 30 40 50 60 65 70 75 80 90 100];
T = T{:,:};
d = diff(T,1,2);
ad = cumsum(eps(1e3)*~[d,zeros(size(T,1),1)],2);
Tw = T + ad;
out = cellfun(@(x,y)interp1(x,throttle(:),y),num2cell(Tw',1),num2cell(torquei'));
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Chassis Systems finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!