use matlab:
A cable of length Lc supports a beam of length Lb so that it ishorizontal when the weight W is attached to the beam end. Thetension force T in the cable is given by the following equation:T=(Lb*Lc*W)/(D*sqrt(Lc^2-D^2)) Where D is the distance of the cableattachment point to the beam pivot. 1. Create a function M-filethat evaluates the tension T as a function of D. In this functionM-file the parameters Lb, Lc, and W should be declared global. 2.Create a script M-file that creates these global variables and: a)Prompts for and accepts the following values from the CommandWindow : W = 400N, Lb= 5 m, and Lc = 3 m (the weight is in Newtons,and the lengths are in meters) b) Uses these values and the fminbndfunction to compute and display in the Command Window the value ofD that minimizes the tension, T, and the minimum tension value. c)Uses fzero to determine by how much the value of D can vary fromit