KpVAR = [0:0.02:1];
N = length(KpVAR);
for I = 1:N
    Kp = KpVAR(I);
    Ki = 0;
    Kd = 0;
    sim('Project_2_PSK_2019.slx')
    K = length(RMSerror);
    E(I)=RMSerror(K);
    U(I)=RMSeffort(K);
    J(I)=sqrt((E(I)^2)+(U(I)^2));
end
plot(KpVAR,E,'*', KpVAR,U,'-', KpVAR,J, 'o'), grid on, xlabel('Kp'), ylabel('E[*],U[-],J[o]')
