interp2 error non monotonus
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Harish Vernekar
am 22 Feb. 2021
Kommentiert: Harish Vernekar
am 23 Feb. 2021
Hello i am facing problem with interp2
i have rpm , torque , efficiency values of motor i need to get eff using interp2
for i=1
torque_motor=data(:,1);
rpm_motor=rpm;
eff_motor=data;
end
for i=1:1:length(torque_motor)
for j=1:1:length(rpm_motor)
for k=1:1:length(data)
temp1=find(torque_motor(:,k)==torque_array(i));
temp2=find(rpm_motor(:,k)==rpm_array(j));
[val,pos]=intersect(temp1,temp2);
eff_epk=column_eff(val)
i=i+1
j=j+1
k=k+1
end
end
end
end
eff_epk
[ttorque,rrpm]=meshgrid(torque_array,rpm_array)
ttorque=ttorque';
rrpm=rrpm';
for i=1:length(t)
EPK_operating=interp2(rrpm,ttorque,eff_epk,Nm,tm)
end
4 Kommentare
Akzeptierte Antwort
Bjorn Gustavsson
am 22 Feb. 2021
It should (big claim, I know) be as simple as:
torque = data(2:end,1);
rpm = data(1,2:end);
eff_epk = data(2:end,2:end);
Nm = [2^.5 exp(-1), pi, exp(2)]; % You'll have more sensible parameters here...
tm = [3 30 300 3000];
EPK_operating=interp2(rrpm,ttorque,eff_epk,Nm,tm);
HTH
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!