フィルターのクリア

trying to solve a computer problem of mechanics of material

9 ビュー (過去 30 日間)
hosi
hosi 2023 年 6 月 20 日
編集済み: hosi 2023 年 6 月 20 日
Hey guys, I'm trying to learn how to use Matlab and I decided to solve some of mechanics of materials ( Beer and Johnston's Mechanics of Materials) computer problems with Matlab to learn how to actually do it, but man I really cant do it and I'm struggeling right now.
The problem that I'm trying to solve atm is 9-C5 which im gonna put the way to solve it on paper in a pic on this post. But I have no idea to actually Code it... I mean I tried some codes but i end up getting wrong answers so I decided to get some help and ask you guys that if it was you how would u write this program? or if its possible can you give me a Hint or help on it?
What this question wants is a input for L, w ,E ,I ,delta_a and outputs like this:
a=0 | theta = 0.7 | y= 1.3
a=0+delta_a | theta= new number using new a | y= new number using new a
.
.
.
a=L | theta = | y=
.I managed to write a code that looks right. I guess i gotta change the question now, how can i ask matlab to write the answers in a excel file like this:
A | B | C
distance | theta | y
a=0 | 0.7 | 1.6
also is it possible to somehow plot the answers i get in each loop?
here is the code (yup I butchered coding world with my zero skills haha)
clc;
clear all;
%Vorodi Haye Karbar%
L = input("Enter the length of the beam? ");
W = input("Enter the Weight on the beam? ");
Delta_a = input("Enter the Delta a? ");
E = input("Enter the Young's Modulus? ");
I = input("Enter the Moments of the section? ");
n= L/Delta_a;
N=n+1; %this line is uselesss now i guess but i saved it as a idea%
while n>-1
x=n*Delta_a;
R=(W/((L)^3))*(((x)^4)-(4*L*((x)^3))+(6*((L)^2)*((x)^2)))';
T=((R*((x)^2))/(2*E*I))-((W*((L)^3))/(6*E*I))';
Y=((R*((x)^3))/(3*E*I))+(L-x)*((R*((x)^2))/(2*E*I))-((W*((L)^4))/(8*E*I))';
fprintf('T= #%d\n', T);
fprintf('Y= #%d\n', Y);
n=n-1;
end

回答 (0 件)

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

タグ

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by