フィルターのクリア

Change variables for regression to use it as dummies

1 回表示 (過去 30 日間)
Max
Max 2022 年 8 月 26 日
コメント済み: dpb 2022 年 8 月 26 日
I would like to change the datas to 0 and 1.
Anything between 0 to 30% will be 0 and anything over 30 should be 1.
Does someone has a script to change it ?
Thats my code to change it into a vertical order (changed the name from Board Gender Diversity to mBoardGenDiv):
mBoardGenDiv = mBoardGenDiv(:,[1:end]);
mBoardGenDiv = mBoardGenDiv(:);
Thanks in advance!
  1 件のコメント
dpb
dpb 2022 年 8 月 26 日
That's trivial use of <Logical Indexing> in MATLAB
mBoardGenDiv=BoardGenderDiversity(BoardGenderDiversity>30);

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeSupport Vector Machine Regression についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by