Finding a range in an array

1 回表示 (過去 30 日間)
Wei Nick Chan
Wei Nick Chan 2016 年 6 月 17 日
コメント済み: Wei Nick Chan 2016 年 6 月 17 日
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!

採用された回答

Andrei Bobrov
Andrei Bobrov 2016 年 6 月 17 日
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))
  1 件のコメント
Wei Nick Chan
Wei Nick Chan 2016 年 6 月 17 日
thanks!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by