how to use command"matlabFunction" in loop and handle function in loop
Mostrar comentarios más antiguos
syms x y
rr=[x^2+y^2,x^2+1,y^2+2,3*x^3;
y^7+2,x^2+y,x^4+y^7,2]
for i=1:8
f(i)=matlabFunction(rr(i))
ma(i)=dblquad(f(i),-1,1,-1,1)
end
Can anyone help!! i really need help!! Above is my code!! my aim is to double integral(dblquad) the code have error when i run it .can any help me to modify it!! rr is my assumption.ecactly rr is big so i use a small matrix to replace
2 comentarios
tony kevine
el 20 de Abr. de 2015
Star Strider
el 20 de Abr. de 2015
Go to the MATLAB Index and search for the function. The approximate release when it first appeared is at the end of the documentation page for it. That is new with the documentation for the R2015a release that is the current online documentation.
Respuesta aceptada
Más respuestas (1)
Sean de Wolski
el 17 de Abr. de 2015
Use cells to store the function handles
syms x y
rr=[x^2+y^2,x^2+1,y^2+2,3*x^3;
y^7+2,x^2+y,x^4+y^7,2]
f = cell(8,1)
for i=1:8
f{i}=matlabFunction(rr(i))
ma(i)=dblquad(f{i},-1,1,-1,1)
end
This won't fix the fact that your functions need different inputs so you'll need to figure that out.
1 comentario
tony kevine
el 17 de Abr. de 2015
Categorías
Más información sobre MATLAB en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!