randsample([0 1],1,true,[1 - p p]) ..... with p as a vector?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have the following code that generates a 0 or a 1 depending on the probability p:
randsample([0 1],1,true,[1 - p p])
But suppose my probability was taken from a vector of other probabilities. Is it possible to ammend my code to handle all probabilities at once, rather than looping through the vector for each probability?
댓글 수: 2
Rik
2018년 11월 29일
I don't understand your question, nor do I have the toolbox for this function, so I can't play around with it for you.
답변 (2개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Biomedical Imaging에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!