Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.1 - English

Change language to:
Français - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2024.1.0. This page might be outdated.
See the recommended documentation of this function

Scilab Help >> Statistics > Sampling > samwr


Sampling without replacement


s = samwr(sizam, numsamp, X)



integer. Size of a sample. It must be lower than or equal to the size of X.


integer. Number of samples to be extracted.


column vector. It contains the population.


matrix of size sizsam * numsamp. It contains numsamp random samples (the columns) each of sizam extractions without replacement from X.


Gives samples without replacement from a column vector.

Random number generator

samwr is based on grand for generating the random samples. Use grand("setsd", seed) to change the seed for samwr.

seed = getdate("s");
grand("setsd", seed); //sets the seed to current date

seed = 0;
grand("setsd", seed); //sets the seed to default value


a = [0.33 1.24 2.1 1.03]
s = samwr(4, 12, a)

See also

  • sample — Sampling with replacement
  • samplef — sample values with replacement from a population with given frequencies.
  • grand — Random numbers
Report an issue
<< samplef Sampling Summaries >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Feb 12 19:26:50 CET 2018