Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need a skeleton of a MatLab code that will find the following: 1. Write a MATL

ID: 2998179 • Letter: I

Question

I need a skeleton of a MatLab code that will find the following:

1. Write a MATLAB function that takes the geometry of each beam and returns its
corresponding moment of inertia.

2. Write a MATLAB function which determines the deflection of a beam based at distance x
from the clamped end for applied load P based on the following equations.

where y is the deflection of the beam, L the length of the beam, a is the applied load distance
from the fixed end, E modulus of Elasticity, I the moment of inertia, and P the applied load at the
free end. Your function should get five inputs namely, modulus of elasticity, moment of inertia, applied
load, load distance from the clamped end and the desired deflection location and returns the
deflection. **Note that as there are two equations for beam deflection, your code should have an if condition
statement to select the proper equation depending on the selected x value.**

Thank you! The most important part that I need is the if condition statement to select the proper equation depending on the selected x value.

I need a skeleton of a MatLab code that will find the following: where y is the deflection of the beam, L the length of the beam, a is the applied load distance from the fixed end, E modulus of Elasticity, I the moment of inertia, and P the applied load at the free end. Your function should get five inputs namely, modulus of elasticity, moment of inertia, applied load, load distance from the clamped end and the desired deflection location and returns the deflection. **Note that as there are two equations for beam deflection, your code should have an if condition statement to select the proper equation depending on the selected x value.** Thank you! The most important part that I need is the if condition statement to select the proper equation depending on the selected x value. 1. Write a MATLAB function that takes the geometry of each beam and returns its corresponding moment of inertia. 2. Write a MATLAB function which determines the deflection of a beam based at distance x from the clamped end for applied load P based on the following equations.

Explanation / Answer

clc;
close all;
clear all;

n=input(' 1. rectangle 2. circle 3. triangle ');

switch n
  
case 2
r=input('radius');
I_x=(pi/4)*r^4;
case 1
h=input('enter length');
b=input('enter breadth');
I_x=b*h^3/12;
case 3;
h=input('enter perpendecular length');
b=input('enter base ');
I_x=b*h^36/36;
end

Mater=input(' 1. steel 2. aluminium ');

switch Mater
  
case Mater==1;
E=200;
case Mater==2;
E=70;
end

L=input('length of the bar');

a= input(' position of load ');

P=input(' value of load ');

for i=1:1000;
  
x(i)=L*i/1000;
  
if x(i)<=a;
  
y(i)=P*x(i)^2.*(3*a-x(i))/(6*E*I_x);
else
y(i)=P*a^2*(3*x(i)-a)/(6*E*I_x);
end
end

x_req=input(' enter the location of desired deflection ');


if x_req<=a;
  
y_req=P*x_req^2*(3*a-x_req)/(6*E*I_x);
else
y_req=P*a^2*(3*x_req-a)/(6*E*I_x);
end

disp(y_req);
  
plot(x,y);
grid
xlabel('position');
ylabel('deflection');
  

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote