MATLAB: Does this split of the plot lines doesn’t work

elseif statementplot

x = linspace(0,8.7,1000)
a = zeros (1,1000)
b = zeros (1,1000)
c = zeros (1,1000)
d = zeros (1,1000)
hold on;
grid on;
%////////////////////////////////////////////////Fall 1///////////////////
figure(1);
for i = 1:1000
a(i) = 6.5*4000./((6.5-x(i)));
b(i) = 10500
c(i) = 6.5*9500./((x(i)));
d(i) = 500./(x(i)-6.5);
if a(i)<b(i)
plot(x,a,'.')
end
if d(i)<c(i)<b(i)
plot(x,c,'.')
end
if d(i)<c(i)
plot(x,d,'.')
end
plot(x,b,'.')
end
axis([0 10 0 12000])

Best Answer

the graph function is not the same as in grafik.png and the lower area needs some improvement, but would you consider the following a start point?
x=[1:1:100];y1=x([1:1:30]);y2=x(3)*ones(1,20);y3=x([30:-1:1]);y4=zeros(1,20);
y=[y1 y2 y3 y4];y=y+10;plot(x,y,'r')
patch('XData',x,'YData',y,'FaceColor','red','LineStyle','none')
axis([0 numel(x) 0 max(y)+5])
z=y-3; % lift
delay=7
z([1:1:end-delay+1])=z([delay:1:end]) % advance
hold all
plot(x,z,'b')