MATLAB: SOLVE ISNT GIVING ME MULTIPLE OUTPUTS

MATLABsolve

i have multiple inputs of that when put in the only four solves at the bottom only give one output unlike they should
for i = 1 : 80
s(i+1) = i;
Y = sym('Y');
syms S
S = solve (Y==((0.02*i)+0.15),Y);
end
syms P1
syms P2
syms P3
syms P4
P1 = solve (P1==((8*0.85)/((8*S)-1))-(27/(64*(S^2))),P1)
P2 = solve (P2==((8*0.9)/((8*S)-1))-(27/(64*(S^2))),P2)
P3 = solve (P3==((8*0.95)/((8*S)-1))-(27/(64*(S^2))),P3)
P4 = solve (P4==((8*1)/((8*S)-1))-(27/(64*(S^2))),P4)

Best Answer

Loop is inefficient so use subs instead:
syms Y P1 P2 P3 P4 s
S = solve (Y==((0.02*s)+0.15),Y);
P1 = solve (P1==((8*0.85)/((8*S)-1))-(27/(64*(S^2))),P1);
P2 = solve (P2==((8*0.9)/((8*S)-1))-(27/(64*(S^2))),P2);
P3 = solve (P3==((8*0.95)/((8*S)-1))-(27/(64*(S^2))),P3);
P4 = solve (P4==((8*1)/((8*S)-1))-(27/(64*(S^2))),P4);
s=1:80;
P1=vpa(subs(P1,s),4)
P2=vpa(subs(P2,s),4)
P3=vpa(subs(P3,s),4)
P4=vpa(subs(P4,s),4)