How to solve error using integral (line 83) first input argument must be a function handle?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Anton K.
el 20 de En. de 2023
It is necessary to calculate the function "z" and its values, to build a 3D graph depending on "x" and "y".
I enter commands:
xi=0.062
m=64
[x,y,ksi]=meshgrid(-1:0.1:1,2:0.2:10,-1:0.1:1)
y1=((sign((x./y)+ksi).*((1+xi)./2)+((1-xi)./2)).*((x./y)+ksi ))^m
z=(integral(y1,0,1)).^(1./m)
After the last command it gives an error:
error using integral (line 83)
first input argument must be a function handle
Tell me, what's the problem?
3 comentarios
Respuesta aceptada
Torsten
el 26 de En. de 2023
T = 1;
m = 64;
x = 1:0.1:2;
y = 2:0.2:10;
[X,Y] = meshgrid(x,y);
g = @(u)sin(2*pi*u);
phi = @(t,x,y) ((sign(x/y+g(t/T)).*(1+t/T)/2+(1-t/T)/2).*(x/y+g(t/T))).^m;
sol = (arrayfun(@(x,y)1/T*integral(@(t)phi(t,x,y),0,1),X,Y)).^(1/m)
3 comentarios
Torsten
el 28 de Feb. de 2023
Editada: Torsten
el 28 de Feb. de 2023
I'm a little bit confused about your t/T with respect to which you integrate.
According to your notation, my guess is that the integral should be
m = 64;
x = 1:0.1:2;
y = 2:0.2:10;
[X,Y] = meshgrid(x,y);
g = @(u)sin(2*pi*u);
phi = @(ksi,x,y) ((sign(x/y+g(ksi)).*(1+ksi)/2+(1-ksi)/2).*(x/y+g(ksi))).^m;
sol = (arrayfun(@(x,y)integral(@(ksi)phi(ksi,x,y),0,1),X,Y)).^(1/m)
which is a little different from which I posted first (at least for T not equal to 1).
Más respuestas (0)
Ver también
Categorías
Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!