Hi,
I have an array composed of pairs of variables,
X=[a1 a2 b1 b2 c1 c2..]
and I want to modify each PAIR by a small random percentage. My percentage modifier is
percent=linspace(0.95,1.05,100);rand_percent=randperm(length(percent));modifier=percent(rand_percent(1:length(X)));
Since 'modifier' is the same length as 'X', if I multiply them together I modify every element of 'X'. However, I need to modify each PAIR by the same percentage, ie
X=[0.99a1 0.99a2 1.02b1 1.02b2 0.95c1 0.95c2..]
I'm getting lost in the arrays on this one, any suggestions?
Best Answer