??? Error using ==> double Too many input arguments.

9 views (last 30 days)
>> syms x t
total = 0;
totalmax = 0;
trest = 0;
t2 = 0;
ton = 0;
h = 0;
pulse = 1;
totaltime = 1440;
p = 5.119*exp(-0.08898*h)+ 13.47*exp(-0.0003734*h);
while pulse <= 1440
while total >= totalmax
for trest=0:totaltime
ton = (totaltime - trest)/pulse;
for i=1:pulse
t2 = double(solve(5.119*exp(-0.08898*t)+ 13.47*exp(-0.0003734*t)-p,'t'));
p = (5.119*exp(-0.08898*(t2+ton))+ 13.47*exp(-0.0003734*(t2+ton)) + 0.05262*trest);
total = total + double(int(5.119*exp(-0.08898*x)+13.47*exp(-0.0003734*x)),x,t2,t2+ton);
end
if total >= totalmax
totalmax = total;
else
trest = trest + 0,01;
if trest == 20
print trest;
end
end
end
pulse = pulse + 1;
print pulse;
end
end
Hi everybody, I seem to be running into trouble where I do the integration, I haven't got a clue how to solve this error though as it seemed to work just fine when I used numerical data for ton and trest.
Please, release me from my misery :D

Accepted Answer

Walter Roberson
Walter Roberson on 3 Feb 2012
Your line
total = total + double(int(5.119*exp(-0.08898*x)+13.47*exp(-0.0003734*x)),x,t2,t2+ton);
should be
total = total + double(int(5.119*exp(-0.08898*x)+13.47*exp(-0.0003734*x),x,t2,t2+ton));
  2 Comments
Bart
Bart on 3 Feb 2012
Shouldn't try to write code so late in the evening :D

Sign in to comment.

More Answers (1)

Kevin Holst
Kevin Holst on 3 Feb 2012
total = total + double(int(5.119*exp(-0.08898*x)+13.47*exp(-0.0003734*x)),x,t2,t2+ton);
Your parentheses are incorrect here. I assume x,t2,t2+ton are parameters for int, they're being input into double (which only wants one input). try:
total = total + double(int(5.119*exp(-0.08898*x)+13.47*exp(-0.0003734*x),x,t2,t2+ton));

Categories

Find more on Mathematics in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!