MATLAB: Finding a range in an array

matrix arraypcolor

Hi MATLAB pros!
I have an array that's like this, it's a 3D plot converted into 2D pcolor plot
x =
11 15 16 18 20 25
y =
10 20 30 40 50
array =
0 0 0 1 2 3
0 0 1 2 4 5
2 3 4 5 6 7
1 2 3 4 5 6
5 6 8 7 5 4
I need the code to work so that it returns the x axis value and y axis value that don't contain any 0 values, it should be something like this:
x =
18 20 25
y =
30 40 50
Any leads for me to achieve this goal? help!

Best Answer

x =[ 11 15 16 18 20 25]
y =[10 20 30 40 50]
a =[0 0 0 1 2 3
0 0 1 2 4 5
2 3 4 5 6 7
1 2 3 4 5 6
5 6 8 7 5 4 ]
xout = x(all(a))
yout = y(all(a,2))