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 ?

 채택된 답변

jonas
jonas 2018년 2월 27일
편집: jonas 2018년 2월 27일

0 개 추천

A=DailyloadProfile(find(DailyloadProfile(:,97)==1),:); B=DailyloadProfile(find(DailyloadProfile(:,97)==0),:);

댓글 수: 2

find is totally superfluous, using logical indexing is faster than using find:
B = A(A(:,97)==1,:)
C = A(A(:,97)==0,:)
Thank you so much sir

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Calendar에 대해 자세히 알아보기

태그

질문:

2018년 2월 27일

댓글:

2018년 2월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by