Your code already is making a series. You could add the envelope, but the only thing you're missing in my opinion is adding the pi/2 line.
You misunderstood the ArrayValued flag: "Set this flag to true or 1 to indicate that fun is a function that accepts a scalar input and returns a vector, matrix, or N-D array output." Your function does not return an array. A small modification will allow array input.
f(u)=integral(fun,1,u,'ArrayValued',false);
[y_hi,y_lo]=envelope(f,300);plot(y_hi),plot(y_lo)
fprintf('pi/%.2f\n',pi/f(end))
fprintf('pi/%.2f\n',pi/(integral(@(w)(sind(w)./w),1,u)))