clear
clf
Kd = 0;
varKp = [0:5:100];
varKi = [0:0.5:10];
J = length(varKp);
I = length(varKi);
for i = 1:I
    Ki = varKi(i);
    for j = 1:J
        Kp = varKp(j);
        sim('Project_3_2018.mdl')
        N = length(RMSE);
        x(i) = Ki;
        y(j) = Kp;
        z(j,i) = RMSE(N);
        M1 = j
    end
    clc
    M2 = i
end
mesh(x,y,z), xlabel('Ki'), ylabel('Kp'), zlabel('RMSE[Volt]')