***MATLAB problem, please explain the setp as well, thanks ***ONLY need question
ID: 3572502 • Letter: #
Question
***MATLAB problem, please explain the setp as well, thanks
***ONLY need question 2
1 Painted plate with holes. A certain assembly calls or a square base plate with ann x pattern of holes drilled in it. The square side length plate thickness rand number n and diameter d of the holes of their diameters must be the are arbitrary, although the the holes must be in an n x n pattern and a same. Nate the physical restriction that nd s. The base plate is to be painted. The total cost is proportional to the volume, surface area, and number otholes. The material is steel which is 75 cents/kg Imass before holes are drilled, the holes cost 5500 per cms of material removed, and paint costs 10 write a program that accepts as input side length, thickness, number of holes, and diameter of each hole, and outputs a. total surface area (for painting) b. total volume and total volume removed (by dr ng holes) ng the fact that the density of steel total co program must check that requirements are physicalv possible, and should do at least rudmentary checking for other erroneous input such a negative dimensions or millions of holes. error is found, the program should not terminate, but should gove the user a chance to re-enterExplanation / Answer
% reading input
s=input('enter length:');
r=input('enter thickness:');
n=input('enter no.of holes:');
d=input('enter diameter:');
% area
% 1a
TSA=(2*s*s)+4*s*r;
ahr=3.14*n*(d*d)/4;
sa=3.14*d*r;
tap=(2*s*s)+(4*s*r)+3.14*d*(r-(n*d)/4);
% volume
% 1b
tvwh=r*s*s;
tvrh=(n*3.14*r*d*d)/4;
tvh=(r*s*s)-(n*3.14*r*d*d)/4;
volume=[tvwh;tvrh;tvh];
% mass
% 1c
mass=(8*((r*s*s)-(n*3.14*r*d*d)/4)*(1.0000e-03));
% 1d
% cost
steelcost=(8*((r*s*s)-(n*3.14*r*d*d)/4)*(1.0000e-05)*75);
holescost=(((3.14*r*d*d)/4))*5;
paintcost=((2*s*s)+(4*s*r)+(3.14*d*(r-(n*d)/4))*0.1);
totalcost=steelcost+holescost+paintcost;
% 2a
% plot
area=[TSA;ahr;sa];
x=horzcat(volume,area);
y = [steelcost;holescost;totalcost];
plot(x, y);
xlabel('volumeandarea');
ylabel('cost');
2
b.
By drawing the graph factors are:
2
C
No other combination of factors. because all are independent.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.