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!