if statements
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Akzeptierte Antwort
the cyclist
am 6 Dez. 2011
A = rand(998,996); % Use your data in place of A
B = not(all(A>0) | all(A<0));
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!