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!
