Equation to Matlab code
显示 更早的评论
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 个评论
Walter Roberson
2021-4-5
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
2021-4-5
Image Analyst
2021-4-5
- 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.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
