I cannot interpret much of your code, so I created my own version to plot the cylinders. You will need to adapt it to what you want to do, specifically with the cylinder radii, since I cannot figure out how that is supposed to work.
The Code —
cylfcn = @(r) r*[cos(linspace(0,2*pi)); sin(linspace(0,2*pi))];
figure
hold on
for k = 1:numel(Qt)
cyl = cylfcn(Qt(k)*1E-3); % Define Radius As ‘Qt(k)/1000’
hs = surf([1;1]*cyl(1,:), [1;1]*cyl(2,:), ([0;1]*hcil)+ones(size(cyl))+hcil*(k-1)); % Plot Cylinders
hs.EdgeColor = 'none'; % Turn Off Edges
hf1 = fill3(cyl(1,:), cyl(2,:), ones(1,size(cyl,2))+hcil*(k-1), 'g'); % Colour Cylinder Lower Surfaces Green
hf2 = fill3(cyl(1,:), cyl(2,:), ones(1,size(cyl,2))+hcil*(k), 'r'); % Colour Cylinder Upper Surfaces Red
% hf1.EdgeColor = 'none'; % Turn Off Edges
% hf2.EdgeColor = 'none'; % Turn Off Edges
end
hold off
view(30,30)
grid on
% axis('equal')
xlabel('X')
ylabel('Y')
zlabel('Z')
The Plot —
Each cylinder is ‘hcil’ units in height. Note that the radii equal to 0 will not plot.
I also demonstrated how to change the properties of the different parts of the plot, so you can customise them so they appear as you want them to appear.
.