Moment diagram code error when using .^2
古いコメントを表示
So i started making shear and moment diagram of uniform distributed load. Watched Youtube and followed some steps however i ended up with problems on moment. Please help
formula on shear -- working
V=Ra*(x>0)-UDL*(x-0).*(x>0)+UDL*(x-4).*(x>4)-cl1*(x>4)-UDL*(x-4).*(x>4)+UDL*(x-12).*(x>12)+Rc*(x>12)-UDL*(x-12).*(x>12)+UDL*(x-18).*(x>18)-cl2*(x==18);
formula on moment --not working (still not complete yet coz im still working on it.
M=-(UDL/2)*(x-0).^2*(x>0) + (UDL/2)*(x-4).^2*(x>4);
1 件のコメント
Jan
2022 年 12 月 8 日
How can we help you? The information that you have seen something on YouTube and that you want to implement a "formula on moment" is not sufficient to explain, what "not working" means.
回答 (1 件)
John D'Errico
2022 年 12 月 8 日
編集済み: John D'Errico
2022 年 12 月 8 日
You SAID that you understand the need for the .* and .^ operators. Then we see this:
M=-(UDL/2)*(x-0).^2*(x>0) + (UDL/2)*(x-4).^2*(x>4);
_ _
And it seems you forgot what you said? The problem is not in the use of .^ but in the use of a different incorrect operator.
What else can I say? :)
カテゴリ
ヘルプ センター および File Exchange で Performance and Memory についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!