Why am I receiving the error not enough input arguments?
Mostrar comentarios más antiguos
Continuing to get the error in line 2 not enough input arguements for the following code:
function[a,v,h]= EngineOne(Fmotor,m,TimeStart,dt,t,TimeEnd)
t=TimeStart:dt:TimeEnd
h=zeros(size(t))
m=413
Fmotor=70
TimeStart=0
dt=1
for i=1:length(t)-1
if t>3
Fmotor=0;
m=370;
end
v(i+1)= v(i)+dvdt(i)*dt
h=v.*t+1./2.*a.*(t).^2
dvdt=Fmotor./m-9.81-(0.00626./m).*sign(v).*(v).^(2)
end
Respuestas (1)
Cris LaPierre
el 15 de Mzo. de 2021
Editada: Cris LaPierre
el 15 de Mzo. de 2021
0 votos
This error means you can created a function with n inputs, but you are calling it with <n inputs. To say for certain, you'll have to share the code you are using to call the function. It would also help if you shared the full error message (all the red text).
If you are getting an error in line 2, it might be because you did not provide 6 inputs. The 6th input is TimeEnd. If that variable does not have an assigned value, it could cause an error in line 2.
2 comentarios
Bella Marra
el 15 de Mzo. de 2021
Cris LaPierre
el 15 de Mzo. de 2021
Editada: Cris LaPierre
el 15 de Mzo. de 2021
Then that explains your problem, because your function is expecting it.
Categorías
Más información sobre Title en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!