How can divide this array into same group ?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Pradya Panyainkaew
le 27 Fév 2018
Commenté : Pradya Panyainkaew
le 27 Fév 2018
I have a matrix contain daily load profile, size 366x97 elements. The column number 97 shows flag of weekday and holiday by 0, 1 respectively.
I want to create matrix A contains only row data with flag 0 (holiday) and matrix B contains only row data with flag 1 (weekday).
How can I separate these raw data into 2 type of day: weekday and holiday ?
0 commentaires
Réponse acceptée
jonas
le 27 Fév 2018
Modifié(e) : jonas
le 27 Fév 2018
A=DailyloadProfile(find(DailyloadProfile(:,97)==1),:); B=DailyloadProfile(find(DailyloadProfile(:,97)==0),:);
2 commentaires
Stephen23
le 27 Fév 2018
find is totally superfluous, using logical indexing is faster than using find:
B = A(A(:,97)==1,:)
C = A(A(:,97)==0,:)
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Calendar dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!