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 commentaire

Jan
Jan le 8 Déc 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.

Connectez-vous pour commenter.

Réponses (1)

John D'Errico
John D'Errico le 8 Déc 2022
Modifié(e) : John D'Errico le 8 Déc 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? :)

Catégories

En savoir plus sur Performance and Memory 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!

Translated by