How do I create dummy variables with if statements?
조회 수: 4 (최근 30일)
이전 댓글 표시
I have a dataset with excess return, R, which consists of 10 000 rows and 1 column.
I want to create a new variable X that takes the value of 1 for each row in R if R>0 for all rows in R. And it takes the value of 0 if R<0.
Probably a simple question, but couldnt find any other answers out there that worked for me.
댓글 수: 0
답변 (1개)
madhan ravi
2020년 11월 6일
편집: madhan ravi
2020년 11월 6일
X = R > 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!