More Related Content
More from ym.ygrex@comp (12)
Divide a data set into sub data sets matlab answers - matlab central
- 2. random_vector=data(:,id)
4 Comments
Show 1 older comment
Comment on this Answer
I do not know what (sample a vector under sampling with replacement)
means. The code pick randomly a vector from the 20 parts, but it can pick
the same another time
Azzi Abdelmalek on 27 Sep 2013
If you want to avoid repetition
A=1:100 % Example
data=reshape(A,[],20) % each column represent your part of data
[n,m]=size(data);
id=randi(m)
random_vector=data(:,id)
data(:,id)=[]
Azzi Abdelmalek on 27 Sep 2013
thank you very much!
dav on 27 Sep 2013
Vote 1
Flag Link
Answer by Jan Simon on 27 Sep 2013
The question is not clear. You have T "data sets" (what ever this mean) and
want to divide it in 20 "sets" of equal size. Is T dividable by 20? Should the
new data sets contain repetitions, e.g. is this allowed:
aNewDataSet = [T(1), T(1), T(3:end)]
Should the new data sets be elementwise distinct or is this allowed:
- 3. newDataSet(1) = [T(1), T(3:10)]
newDataSet(2) = [T(1), T(4:11)]
When only one data set is used afterwards, why creating 20 of them at first?