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!