Split a vector into two vectors randomly

조회 수: 4 (최근 30일)
neamah al-naffakh
neamah al-naffakh 2016년 12월 22일
편집: neamah al-naffakh 2016년 12월 23일
hi, I have a vector that has 36 values and I'd like to split it into two vectors randomly. ( the first vector has 25 values and the second has 11 values ).
I have written this code but when i have repeated values in the original vector, i will not get 11 samples in the second vector because of this command
I really appreciate any help guys. Kind Regards.

채택된 답변

Roger Stafford
Roger Stafford 2016년 12월 22일
편집: Roger Stafford 2016년 12월 22일
Why not do this:
t = original_vec(randperm(Total_Samples));
First_vec = t(1:25);
Second_vec = t(26:36);
  댓글 수: 1
neamah al-naffakh
neamah al-naffakh 2016년 12월 22일
thank you so much :) you are really kind

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Financial Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by