Ah, this is a fun question, because the concept it's getting at is quite common across science and engineering.
The process of manufacturing resistors isn't perfect, so a 100 Ohm resistor might actually have a value anywhere between 95 and 105 Ohms. To make a uniform distribution of values between 95 and 105 Ohms, you could use the rand function, which creates values between 0 and 1. This means you'll want to multiply rand by 2 times the full spread, and center it so half the values are less than zero and half the values are greater than zero.
ErrorDistribution = 2*(percent_error/100)*NominalResistance*(rand(1000,1)-0.5);
R = NominalResistance + ErrorDistribution;