Why I'm getting error (too many arguments) in my integral
3 次查看(过去 30 天)
显示 更早的评论
I'm trying to do a double integral with comand int but it appears an error to me that says too many arguments. What's wrong in my code?
%Hallando el flujo electrico parte delantera
Intdoble1=int(int(2*y^2+z,x,0,1),4*y,y,0,1);
%Hallando el flujo electrico parte trasera
Intdoble2=int(int(2*y^2+z,x,0,1),y,0,1);
%Hallando el flujo electrico parte derecha
Intdoble3=int(int(2+z,x,0,1),y,0,1);
%Hallando el flujo electrico parte izquierda
Intdoble4=int(int(0,x,0,1),y,0,1);
%Hallando el flujo electrico parte superior
Intdoble5=int(int(2*y^2+1,x,0,1),4*x*y,y,0,1);
%Hallando el flujo electrico parte inferior
Intdoble6=int(int(2*y^2,x,0,1)4*x*y,y,0,1));
FE=Intdoble1+Intdoble2+Intdoble3+Intdoble4+Intdoble5+Intdoble6;
1 个评论
回答(1 个)
John D'Errico
2022-5-14
编辑:John D'Errico
2022-5-14
You need to pay MUCH more attention to your code.
For example, just a quick look shows this:
Intdoble6=int(int(2*y^2,x,0,1)4*x*y,y,0,1));
Look inside:
int(2*y^2,x,0,1)
That is the inner call to int. It is fine. But then what do you do? We see:
int(2*y^2,x,0,1)4*x*y
What is that spare 4*x*y? If you wanted to multiply by that expression, you need a * operator. So that line has invalid syntax.
How about this one?
Intdoble1=int(int(2*y^2+z,x,0,1),4*y,y,0,1);
In there, we see the outer call to int has 5 (FIVE) arguments. But int requires 4 arguments. So what is that spare 4*y doing in there?
In fact, in every case, the outer call to int has 5 input arguments.
Now go back and carefully read the error message. Did it say, TOO MANY ARGUMENTS? Look at your code. Read the error messages. They are there to guide you, not to just take up space.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!