clear;
format long
% Hasil REKAP
Kp = [0.554577220576924
   0.554177220576924
   0.554177220576924];
;
Kd = [6.552720021533880
    6.556720021533880
    6.563720021533880];
N = length(Kp);
Count = 0;
for i = 1:N
    x = Kp(i);
    for j = 1:N
        y = Kd(j);
        Count = Count + 1
        sim('Motor_DC_Experiment_var_Kp_Kd',200);
        k = length(J);
        z(i,j) = J(k);
    end
end
clf
mesh(Kp,Kd,z),grid on, xlabel('Kp'), ylabel('Kd'), zlabel('J')
