clear
clf
varB = [0:0.1:2];
varK = [0:0.5:10];
J = length(varB);
I = length(varK);
for i = 1:I
    K = varK(i);
    for j = 1:J
        B = varB(j);
        sim('Project_2_2018.mdl')
        N = length(RMSX);
        x(i) = K;
        y(j) = B;
        z(i,j) = RMSX(N);
        M1 = j
    end
    clc
    M2 = i
end
mesh(x,y,z), xlabel('K [N/m]'), ylabel('B [N.sec/m]'), zlabel('RMSEX [m]')