How to create a set of 50,000 numbers with specific step size

9 ビュー (過去 30 日間)
Christina Williams
Christina Williams 2019 年 3 月 4 日
回答済み: Kevin Phung 2019 年 3 月 4 日
I'm trying to generate a new set of 50000 uniformly distributed random numbers and use these random numbers to generate a set of 50000 samples of the photon step size (µs = 100 cm-1 ). Unfortunatly, I can only find the functions linspace, which will give me evenly spaced numbers, but not the amount i need and

回答 (1 件)

Kevin Phung
Kevin Phung 2019 年 3 月 4 日
how about this alternative?
step = 0.1 %whatever step size you want
r = randi([1 100],1,100) %this generates 100 random integers from 1 to 100.
% Just adjust these parameters to what you need.
rand_val = step*r; %rand_val is now a vector of values all divisible by your step size.

カテゴリ

Help Center および File ExchangeDescriptive Statistics and Visualization についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by