Symbolic Integration Help
Mostra commenti meno recenti
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
Risposta accettata
Più risposte (1)
Paulo Silva
il 23 Gen 2011
0 voti
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).
Categorie
Scopri di più su Conversion Between Symbolic and Numeric in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!