Borrar filtros
Borrar filtros

How to use interp1 in for loop?

4 visualizaciones (últimos 30 días)
Akshay Apte
Akshay Apte el 24 de Mzo. de 2016
Editada: Walter Roberson el 24 de Mzo. de 2016
I have a curve representing engine power. I have to find a particular value on this curve where my engine power curve intersects. This I have to find at each step ranging from 1 to 1875 values. I used interp1 function but it gives error that it requires atlas 2 values to compute. My x-axis is Engine Power (Torque multiplied speed) and y-axis has either speed/torque. When I enter this graph with my engine power i need the point where I can find exact value on curve so that I would know the torque and speed for the power. Hoping for a positive reply
  2 comentarios
Muhammad Usman Saleem
Muhammad Usman Saleem el 24 de Mzo. de 2016
Editada: Muhammad Usman Saleem el 24 de Mzo. de 2016
read documentations about interpolate1 it is interpolating data in one dimension. Please share data use and code you are trying
Akshay Apte
Akshay Apte el 24 de Mzo. de 2016
Editada: Walter Roberson el 24 de Mzo. de 2016
for it=1:numel(t)
%Battery power
if Pel(it)>0
%control strategy
socmin=0.3;
socmax=0.7;
if (soc(it-1)<socmin)||((soc(it-1)<socmax)&&(Switch==1))
r(it)=min(1,(soc(it-1)-socmin)/(socmax-socmin));
Peng1(it)=(1-r(it)).*((Pel(it)/EffPE)+Auxpower);
Eng_rpm_act(it)=interp1(Pool_engine(it),ool_speed_int(it),Peng1(it),'linear');
Eng_tq_act(it)=interp1(Pool_engine(it),ool_tq_int(it),Peng1(it),'linear');
Peng(it)=Eng_rpm_act(it).*Eng_tq_act(it)*pi/30;
end
This is just a part of the program. I need Eng_rpm_act and Eng_tq_act at each step. If there is another method please share. Pool_engine is the curve consisting of-ool_speed_int and oil_tq_int multiplied. Thanks

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by