Could you please solve this using MATLAB.
Problem 10.1 (Using Arrays)
Draw the FLOW CHART and write a C code program THAT USES ARRAYS to calculate the shear and moment at every foot on a 20-foot long uniformly loaded beam. Produce an output table as shown below. Include a decision structure in the loop structure to print a message if the maximum moment (m_max) is higher than the maximum allowable moment (m_allow) and print a message indicating this. Inside the loop, include a decision structure to determine the maximum moment (m_max) along with the distance (x) at which this maximum moment occurs on the beam. Indicate the value of the maximum moment (m_max) and where it is located (x). Outside the loop, include a decision structure to determine if the beam is safe and print a message indicating safe or unsafe.
Input data:
Output data: x[L+1] - distance array v[L+1] - shear array m[L+1] - moment array m_max - maximum moment
w - load (user input) L - length (defined as 30) M_ALLOW - maximum allowable moment (defined as 5000) distance - value of x at m_max
Equations:
v = w * L/2 - w * x
m = w * L * x/2 - w * x^2/2
OUTPUT SHOULD APPEAR AS FOLLOWS
Enter the uniformly distributed weight in lb./ft. >> 40
Weight is 40.00 lb/ft.
Length is 30.00 ft.
DISTANCE (x ft.)
SHEAR (V lbs.)
MOMENT (M ft-lb)
0 1 2
600 560 520
0 580 1120
14 15 16
40 0 -40
4480 4500 4480
29 30
560 -600
580 0
Beam is safe, allowable moment is 5000 ft-lb.