Filter löschen
Filter löschen

Too Many Input Arguments

3 Ansichten (letzte 30 Tage)
Ivan Dwi Putra
Ivan Dwi Putra am 2 Dez. 2020
Kommentiert: Ivan Dwi Putra am 2 Dez. 2020
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

Akzeptierte Antwort

KSSV
KSSV am 2 Dez. 2020
Bearbeitet: KSSV am 2 Dez. 2020
The function takes 15 inputs and you are giving 16 inputs. Please check.
I feel the first input ua(j,i) is extra.
  4 Kommentare
KSSV
KSSV am 2 Dez. 2020
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 am 2 Dez. 2020
ok thank you

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Deep Learning Toolbox finden Sie in Help Center und File Exchange

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by