Equation to Matlab code
Afficher commentaires plus anciens
Hey, I need to write the following equations in MATLAB code. I can't find a mistake, but the displayed results are also not what I was expecting.
Could someone check for me maybe?

This is what I wrote:
y1 = (-W.*x1)./(384*E*I).*(16.*x1.^3-24*L.*x1.^2+9*L^2)+(M.*x1)./(6*E*I*L).*(x1.^2-3*L.*x1+2*L^2);
y2 = (-W*L)/(384*E*I).*(8.*x2.^3-24*L.*x2.^2+17*L^2.*x2-L^3)+(M.*x2)./(6*E*I*L).*(x2.^2-3*L.*x2+2*L^2);
3 commentaires
Walter Roberson
le 5 Avr 2021
just in case you deal with vectors, change all * to .* and all / to ./
Also it can be rewriten in terms of a new variable that is x/L in which case the pieces become 0 to 1/2 and 1/2 to 1
Lucca Martinelli
le 5 Avr 2021
Image Analyst
le 5 Avr 2021
- What were your input variable values?
- What did you get?
- What were you expecting?
Here is the pointing guideline FAQ again:
Also, I'll format your code as code by clicking on the Code icon, hopefully it's something you'll do yourself next time.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Matrix Indexing 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!
