The problem must be done using matlab please help me with the code

thank you

The problem must be done using matlab please help me with the code

thank you

minVelocity=10;
maxCost=600;

The summit must be done using matlab

please acceleration me with the code

thank you

You are cunning a gravity-driven impart tank likely amid monetary consume limitations. As shown in the likeness and pipe plan to set free impart at the main celerity beneath, the tank allure be built on hill at some summit (2). The celerity of impart departureing the pipe must be at meanest 10 m/s. You keep $600 to exhaust on the pipe, and the pipe consumes $25 per meter coercion t meter. Write a MATLAB m-file to finish the aftercited goals: he primeval I0 meters(and $15 per meter coercion cach attached 1. Calculate the celerity of impart departureing the pipe coercionleleven similar-spaced values of z ranging rom 0 to 30 m. Engender a devise of impart departure celerity coercion z values manging frotn o k0m abel he as o 30 m. Label the axes, 3. Determine the hcight2 coercion which the departure celerity is as-well late and manifest this summit on the 4. Coercion each of the eleven similar spaced values of z, abuse the consume of the pipe, and engender a 5. Determine the summit z coercion which the pipe is as-well dear and manifest this summit on the devise including the rectify units devise with a upright row made of 20 x’s. devise of pipe consume vs, z. Label the axes, including rectify units. with a upright row made of 20 o’S Turn in a printout of your completed m-file and the brace devises. z=0.9x Pipe Length . Departure Celerity = V2gz

minVelocity=10;

maxCost=600;

price1=25;

price2=15;

g=9.81;

z=linspace(0,30,11);

exitVelocity=sqrt(2*g*z);

plot(z,exitVelocity);

xlabel(‘summit of impart tank(m)’);

ylabel(‘departure celerity(m/s)’);

hold on

minVelZ=(minVelocity^2)/(2*g);

zLine=minVelZ*ones(1,20);

vLine=linspace(min(exitVelocity),max(exitVelocity),20);

plot(zLine,vLine,’x’);

pipeCost=zeros(1,11);

coercion i=1:11

x=z(i)/.9;

pipeLength=sqrt(x^2+(z(i))^2);

if pipeLength<=10

pipeCost(i)=price1*pipeLength;

else

pipeCost(i)=price1*10+(pipeLength-10)*price2;

end

end

figure(2)

plot(z,pipeCost)

xlabel(‘summit of impart tank(m)’);

ylabel(‘consume of pipe($)’)

hold on;

maxLength=(maxCost-price1*10)/price2+10;

maxHeight=.9*maxLength/(sqrt(1+.9^2));

zLine2=maxHeight*ones(1,20);

cLine=linspace(min(pipeCost),max(pipeCost),20);

plot(zLine2,cLine,’o’)