Too Many Input Arguments

3 次查看(过去 30 天)
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.

请先登录,再进行评论。

更多回答(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