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 ?

 Akzeptierte Antwort

jonas
jonas am 27 Feb. 2018
Bearbeitet: jonas am 27 Feb. 2018

0 Stimmen

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

2 Kommentare

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Holidays / Seasons finden Sie in Hilfe-Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by