Symbolic Integration Help
Show older comments
I want to integrate this function, with respect to x...
y=1/((1+x^2)*(1+x^2+B1^2)^.5)
and B1 is a changing variable. If B1 is a constant, I carried out the symbolic integration like this...
y=sprintf('1/((1+x^2)*(1+x^2+(%1.3f)^2)^.5)',B1); s=int(y,z1,z2);
where z1 and z2 are my limits of integration and it works. How can I perform this integration when B1, z1, and z2 are changing? I tried doing a for loop, but it didn't work.
for x=1:100 y(x)=sprintf('1/((1+x^2)*(1+x^2+(%1.3f)^2)^.5)',B1(x)); s(x)=int(y(x),z1(x),z2(x)); end
Accepted Answer
More Answers (1)
Paulo Silva
on 23 Jan 2011
0 votes
Use the function syms to declare symbolic variables and subs to replace a variable with a specific value, you might also need to use the function vectorize to convert symbolic expressions to char (just in case you want to plot something).
Categories
Find more on Conversion Between Symbolic and Numeric in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!