Moment diagram code error when using .^2
1 view (last 30 days)
Show older comments
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 Comment
Jan
on 8 Dec 2022
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.
Answers (1)
John D'Errico
on 8 Dec 2022
Edited: John D'Errico
on 8 Dec 2022
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? :)
0 Comments
See Also
Categories
Find more on Performance and Memory in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!