Not enough input arguments error in matlab

14 Ansichten (letzte 30 Tage)
Meme
Meme am 9 Mär. 2015
Kommentiert: Star Strider am 10 Mär. 2015
This is my matlab code , I got Not enough input argument error in line 2 and i don't know how to fix it. Anyhelp ? Thanks in advance.
function [] = Integr1( F,a,b )
i = ((b - a)/500);
x = a;k = 0; n = 0;
while x <= b
F1 = F(x);
x = x + i;
F2 = F(x);
m = ((F1+F2)*i)/2;
k = k +m;
end
k
x = a; e = 0; o = 0;
while x <= (b - 2*i)
x = x + i;
e = e + F(x);
x = x + i;
o = o + F(x);
end
n = (i/3)*(F(a) + F(b) + 2*o + 4*e)
  1 Kommentar
Image Analyst
Image Analyst am 10 Mär. 2015
You forgot to give us the error message. You snipped out just a small, almost worthless, part of it. Please copy and paste the ENTIRE error message - that means ALL THE RED TEXT , not just some of it.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Star Strider
Star Strider am 10 Mär. 2015
I ran the essence of your code (I didn’t run it as a function) and it ran for me without error.
Check the way you called your function.
  4 Kommentare
Meme
Meme am 10 Mär. 2015
thank you much for your help
Star Strider
Star Strider am 10 Mär. 2015
My pleasure.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Entering Commands finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by