【发布时间】:2014-06-29 17:52:58
【问题描述】:
我正在尝试生成具有以下特征的整数随机向量:
min(V) = my_min; max(v) = my_max;
If I suppose to divide the vector in some intervals, e.g.:
V = [my_min, v1, v2, v3,...,my_max];
first interval is my_min, v1;
second one interval is v1,v2
etc
我会在每个区间生成不同数量的值,并且每个区间必须只有唯一值。 我认为 randperm 但我无法定义最小和最大间隔,例如V1 V2 例如,我会得到以下向量,其中
my_min = 0;
my_max = 65;
V1 = 10;
V2 = 20;
V3 = 50;
V4 = 60;
V = [0 1,2,5 10, 13,14, 20,25,45,46,48,50,55,56,58, 60,61,62,65]
【问题讨论】: