trying to use quadv for a symbolic function?
이전 댓글 표시
Hello all,
I am planning on running the quadv routine on a function that has been symbolically created, and am having trouble.
What I did was to first create a function that within it, involves symbolic variables x1 and x2. (doesn't work)
I want to be able to run the quadv function on only one of the parameters given, say x1, so that the final integrated solution only varies in x2.
Here is a simple representation of what I have right now:
function fun=myfun(alpha)
syms x1 x2
fun=x1*x2%function itself simplified to visualize concept
subs(fun,'x2',alpha)
end
%another program
quadv(myfun,1,2000)% this will perform integration on x2 so when done function % will be in x.
Any help will be appreciated. Also, as a side question- is there any way to create a function and also call the function in the same file?
thanks to all in advance.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!