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!
