Generate Random Number, that is that is repeatable
Afficher commentaires plus anciens
Hi,
I have generated a code in order to replace the entire original column, with random repeated value but it doesnt give the desired output
% Code is
if range(Selected_Data1(:,1)) ==0
for Iter=1:length(Selected_Data1)
rng(1);
P_MMSI(Iter) = rand(1);
end
end
The above code always replace the value 209026000 with 0.417022004702574, nevertheless, I am expecting the random output vector would be 9 interger numbers (e.g., 781234012)
For example, if the original column is
209026000
209026000
209026000
209026000
209026000
209026000
209026000
209026000
209026000
209026000
% The expected output would be something
781234012
781234012
781234012
781234012
781234012
781234012
781234012
781234012
781234012
Réponse acceptée
Plus de réponses (1)
Catégories
En savoir plus sur Characters and Strings dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!