Hello,
I am new programming in MATLAB so i do not really know all its commands, but i am trying. for the code below i need to find the values of for F,GH,BH and out of the values i find for BH i need to find it's Maximum and Minimun. I also have to find the Maximum value for GH. the values of x varies from 0 to 57.5. It is important to note that there are two especial cases when x<7.5 and x>50. once i have all the values i have to plot BH and GH as a fucntion of x. Please help

%Computer Program 6.C

x=0:0.5:57.5;
h=sqrt(16.5.^2+12.5.^2);
b=7.5;
for x=0:.5:7
disp('for the value of x')
x
F=15*(50-x);
GH=(12.5*F-750*(12.5-x))/16.5;
BH=16.5*GH;
end
for x=50.5:.5:57.5
disp('for the the value of x')
F=15*(50-(x-b));
GH=(12.5*F-750*(12.5-(x-b)))/16.5;
BH=(16.5*GH-750*(x-b))*h/206.25;
end
F=15*(100-2*x+b);
GH=(12.5*F-18750+1500*x+750*b)/16.5;
BH=(16.5*GH-1500*x+750*b)*h/206.25;
MAX(BH)
MIN(BH)
MAX(GH)
hold (BH,x,'b+-)')
Plot(GH,x,'g+-)')
axis([BH GH],X)

I Kept working on it and this is what i have so far

%Computer Program 6.C
clc;
x=0:0.5:57.5;
h=sqrt(16.5.^2+12.5.^2);
b=7.5;
for x=0:.5:7
%disp('for the value of x');
x;
F1=15*(50-x);
GH1=(12.5*F1-750*(12.5-x))/16.5;
BH1=16.5*GH1;

end
for x=7.5:50.0
F2=15*(100-2*x+b);
GH2=(12.5*F2-18750+1500*x+750*b)/16.5;
BH2=(16.5*GH2-1500*x+750*b)*h/206.25;


end
for x=50.5:.5:57.5
%disp('for the the value of x');
x;
F3=15*(50-(x-b));
GH3=(12.5*F3-750*(12.5-(x-b)))/16.5;
BH3=(16.5*GH3-750*(x-b))*h/206.25;

end

%Error is only taking the last value for everything and putting it in here
Range_BH=[BH1,BH2,BH3];
Range_GH=[GH1,GH2,GH3];
Range_F=[F1,F2,F3];
min(Range_BH);
max(Range_BH);
max(Range_GH);
%plot(Range_BH,x,('r+'))
%xlabel(' x values (ft)')
%ylabel('Member BH (lb)')
%axis([0 575000 -950000 800000])

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.