How can I label a vector?
古いコメントを表示
Hello,
I have a vector of 10 random numbers. I want to label the first 5 elements in the vector as '1'. I want to label the last 5 elements in the vector as '0'. How can I do this?
Thanks!
採用された回答
その他の回答 (1 件)
madhan ravi
2018 年 11 月 29 日
編集済み: madhan ravi
2018 年 11 月 29 日
x(1:5)=1; % where x is your random vector
x(end-4:end)=0;
カテゴリ
ヘルプ センター および File Exchange で Descriptive Statistics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!