Function output is returning equation not value
古いコメントを表示
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
回答 (1 件)
Star Strider
2021 年 10 月 14 日
1 投票
カテゴリ
ヘルプ センター および File Exchange で Aerospace Blockset についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
