Why am I receiving the error not enough input arguments?
显示 更早的评论
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
回答(1 个)
Cris LaPierre
2021-3-15
编辑:Cris LaPierre
2021-3-15
0 个投票
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 个评论
Bella Marra
2021-3-15
Cris LaPierre
2021-3-15
编辑:Cris LaPierre
2021-3-15
Then that explains your problem, because your function is expecting it.
类别
在 帮助中心 和 File Exchange 中查找有关 Title 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!