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