Error calling 'int'. This call-site passes more inputs to this function than it can accept.

20 Ansichten (letzte 30 Tage)
I'm trying to make a user defined function for integration. It gives an error Error calling 'int'. This call-site passes more inputs to this function than it can accept.
My code is:
function y = fcn(u,a,b)
%#codegen
y=int(u,a,b)
end
where a = t-0.1 ;
b=t
t is input from clock
Please help how to resolve this.
  4 Kommentare
Walter Roberson
Walter Roberson am 28 Okt. 2018
Are you sure you want to do symbolic integration?
What I suspect is that you want to use trapz()
Kiran Mahmood
Kiran Mahmood am 29 Okt. 2018
Yes it is not a symbolic integration. What I'm trying to do is..I want to integrate a function over time from t-h to t. where t is simulation running time and h=0.1

Melden Sie sich an, um zu kommentieren.

Antworten (1)

madhan ravi
madhan ravi am 28 Okt. 2018
Bearbeitet: madhan ravi am 28 Okt. 2018
what happens when you do this :
y = integral ( @(t) u,a,b )
  3 Kommentare
Kiran Mahmood
Kiran Mahmood am 28 Okt. 2018
Undefined function or variable 't'. I don't know how to set this t as simulation time.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu General Applications finden Sie in Help Center und File Exchange

Produkte


Version

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by