if statements
3 ビュー (過去 30 日間)
古いコメントを表示
I have a set of data with 996 columns and 998 rows. Could I construct if statements so that each column returns 0 if all values are positive or all values are negative, and 1 if there is some combination of the two?
0 件のコメント
採用された回答
the cyclist
2011 年 12 月 6 日
A = rand(998,996); % Use your data in place of A
B = not(all(A>0) | all(A<0));
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!