Skip to content

Instantly share code, notes, and snippets.

@egglang
Created December 22, 2016 04:56
Show Gist options
  • Save egglang/e46dc4e062d49ebcc69e0d1cec1b5a89 to your computer and use it in GitHub Desktop.
Save egglang/e46dc4e062d49ebcc69e0d1cec1b5a89 to your computer and use it in GitHub Desktop.
MATLAB code plotting failure
x_f = [ 0 0 9 9 9 9 9 9 9 9 -9 -9 0 0 9 9 9 9 9 9 -9 0 0 -8 -8 -8 -8 -4.5 8.0 8.0 8.0 4.5 4.5 4.5 -0.2 -0.2 -0.2 -0.2 -0.2 0.2 9.0 9.0 9.0 9.0 9.0 8.0 8.0 8.0 7.6 7.6 7.6 7.6 ]
y_f = [ 0 22 22 22 11 11 11 11 11 11 11 11 22 22 11 11 11 11 22 22 22 20 20 20 20 20 20 11 20 20 20 11 11 11 11 11 11.2 11.2 11 11.2 11.2 11 11 11 10.8 11 11 11 11 11 11 11 ]
result_f = [ 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ]
who_f = [ 1 1 2 2 3 3 3 3 3 3 4 4 2 2 5 5 4 4 4 4 3 2 2 3 3 3 3 1 4 4 4 5 5 5 1 1 3 3 1 4 5 3 3 3 4 1 1 1 5 5 4 4 ]
N = numel(x_f)
nx = randi(10,1,N) .* 0.05
ny = randi(10,1,N) .* 0.025
A = round(rand(1,N));
A(A==0) = -1
x_f2 = x_f + (nx .* A)
A = round(rand(1,N));
A(A==0) = -1
y_f2 = y_f + (ny .* A)
x_f(1) = 0
y_f(1) = 0
who_f(1) = 0
gscatter(x_f2,y_f2,who_f,'krgbcm','*xxxxx')
xlabel('Width (m)');
ylabel('Depth (m)');
legend('Speaker position', 'Numanoi Failure', 'Nakamura Failure', 'Hashimoto Failure', 'Iwanaga Failure', 'Egawa Failure')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment