interp2 error non monotonus
Mostrar comentarios más antiguos
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 comentarios
Jan
el 22 de Feb. de 2021
This is very confusing:
i=i+1
j=j+1
k=k+1
It is useless for the loop counter k, because the FOR command ignores changes of its counter inside the loop. But here you change the counters of the outer loops also. Is this really wanted?
You are overwriting the value of eff_epk in each iteration. Is this really wanted?
The body of the final loop does not depend on the loop counter i .
Finally the readers have to guess, which line is failing with which error message. Please post a copy of the complete message. As long, as you do not explain, what the code should do, and the code fails, the readers have to guess the intention of the code.
I guess, that the message you see means, that the input data of interp2 are non strict monotonically increasing.
KSSV
el 22 de Feb. de 2021
WE cannot help unless data is known to us.
Harish Vernekar
el 22 de Feb. de 2021
Harish Vernekar
el 22 de Feb. de 2021
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre MATLAB en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
