Function output is returning equation not value
Afficher commentaires plus anciens
Hi guys,
Im fairly new to MATLAB and im sure this is a quick fix...
I made a function to calculate the twist of a beam.
my last line of code is convertinf the answer in rad to degrees.
the fuction returns the devision the last line does not the value of the devision.
when I evaluate I get the correct answer. I want the function to just output the twist angle in deg.
Any ideas?
function P = twist(funky,A,B,G,Rinner,Router)
J = (pi/2)*(Router^4-Rinner^4); %calculate j in m^4
syms x;
t_x = int(funky,0,x);% intergrate internal tourqe function from 0 to x
pretty(t_x) %display intergration in nice format
T = int(t_x,A,B);%calculate intergral of t(x) dx and evaluate from A to B
rad = T/(G*J);% phi equation in rad
P = ((rad)*(180))/(pi);% convert red to deg
end
Réponses (1)
Star Strider
le 14 Oct 2021
1 vote
Catégories
En savoir plus sur Aerospace Blockset dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
