Moment diagram code error when using .^2

1 visualización (últimos 30 días)
Joshua Casas
Joshua Casas el 8 de Dic. de 2022
Editada: John D'Errico el 8 de Dic. de 2022
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 comentario
Jan
Jan el 8 de Dic. de 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.

Iniciar sesión para comentar.

Respuestas (1)

John D'Errico
John D'Errico el 8 de Dic. de 2022
Editada: John D'Errico el 8 de Dic. de 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? :)

Categorías

Más información sobre Performance and Memory en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by