Symbolic Integration Help
Afficher commentaires plus anciens
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
Réponse acceptée
Plus de réponses (1)
Paulo Silva
le 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).
Catégories
En savoir plus sur Conversion Between Symbolic and Numeric dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!