필터 지우기
필터 지우기

Too Many Input Arguments

조회 수: 3 (최근 30일)
Ivan Dwi Putra
Ivan Dwi Putra 2020년 12월 2일
댓글: Ivan Dwi Putra 2020년 12월 2일
I have checked the number of arguments in the traindiscretemodel function and in the main Train_PF program the number is the same, but it says error too many input arguments
Error using traindiscretemodel
Too many input arguments.
Error in Train_PF (line 85)
[Pa(j+1,i),Va(j+1,i),Ta(j+1,i)] =
traindiscretemodel(ua(j,i),Tim_step,Pa(j,i),Va(j,i),Ta(j,i),Mass(i),Ca_0(i),Ca_1(i),Ca_2(i),R(i),Eta,fR,g,Cw,A,rho)
this is my train discrete model function
function [PositionN, VelocityN, TorqueN] = traindiscretemodel(Tim_step,Position,Velocity,Torque,Mass,Ca_0,Ca_1,Ca_2,R,Eta,fR,g,Cw,A,rho)
% Train Model
PositionN = Position + Velocity*Tim_step;
VelocityN = Velocity + 1/Mass *(Eta*Torque/R - (Ca_0 + Ca_1*Velocity + Ca_2*Velocity^2))*Tim_step;
TorqueN = (((fR*Mass*g*Cos(Theta) + Mass*g*Sin(Theta) + 1/2*Cw*A*rho*Velocity^2 + Mass*Velocity)*R)/4*Num_veh)*Tim_step;
end

채택된 답변

KSSV
KSSV 2020년 12월 2일
편집: KSSV 2020년 12월 2일
The function takes 15 inputs and you are giving 16 inputs. Please check.
I feel the first input ua(j,i) is extra.
  댓글 수: 4
KSSV
KSSV 2020년 12월 2일
The respective functions are Cos and Sin, I don't think they are inbuilt functions. The input functions are cos, sin (first letter is small, see the difference). If the error too many input arguments is solved, then you will know about this.
Ivan Dwi Putra
Ivan Dwi Putra 2020년 12월 2일
ok thank you

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by