Suppose I have created the matrix C=[1 2 3; 3 4 5;6 7 8;9 10 11;12 13 14;15 16 17];
and I would like to pick up any row vector randomly from this C matrix.
Which MATLAB command/function useful for this?
Perhaps you may try to obtain the random row from your matrix with this code:
C = [1 2 3; 3 4 5; 6 7 8; 9 10 11; 12 13 14; 15 16 17];
N1 = 1;
N2 = 6;
r = randperm(N2, N1);
randomMatrixRow = C(r, :);
Hi, if I understand well, you need an integer random number generator.
You can use the 'randi' MATLAB function to generate random integers between 1 and the number of lines of your matrix. Best
Dear Anita Zade,
Also you can use function called randsample in Statistics Toolbox or like sayed Prof Richard Epenoy use "randi" in Matlab.
Best regards
Here is another piece of code (according to colleague Richard Epenoy):
sz = size(C);
r = randi(sz(1));
randomMatrixRow = C(r, :)
You can usa the randperm function
Row = C(randi(length(C),1,1),:)
To Kiarash Aryankia: it is such a neat piece of code!
Very grateful to see all the optional answers.
For me randsample function worked perfectly.
c=[1 2 3; 3 4 5;6 7 8;9 10 11;12 13 14;15 16 17 ];
[m,n] = size(c )
idx = randsample(m,1 )
iwant = c(idx,:)
After transfection with the plasmid ( linearized ) and subcloning of the cell lines, RNA was extracted from the cell and then reverse transcripted to cDNA. When PCR reactions were run to verify...
25 February 2021 5,712 3 View
Wish to publish an article but in a cost-free journal. Need the assistance of researchers on good indexed journals free of predatory. Thank you
23 September 2020 5,372 3 View
I need to identify my populations from my FASTA file in R so that R can then run all my stats. However, I do not know how to tell R how to group my data into 4 populations! This is the warning...
09 September 2020 8,875 2 View
Dear you all: Recently i met with such a problem: i tryed to generate a ascii format buffer in gis, but i failed because it's headers are different from the research data. Failed result are shown...
11 August 2020 5,040 3 View
As it is not directly my field, I would like to ask for help in terms of the correlation between light intensity, wavelength, frequency and amplitude. Let's say, I have a radiophotometer which...
29 April 2020 9,141 2 View
Specifically, I am looking at the species Alatina alata. I am having trouble both finding the statoliths and also extracting them for further analysis. I have been freezing specimen before I am...
24 April 2019 7,943 2 View
So i have a study with both males and females, they will both be shown a negative image and their brain reaction recorded and a positive image with their brain reaction recorded what analysis in...
30 March 2019 4,571 6 View
Hey guys, I need your help to decide if I should include floating dead cells in my western blot analysis. I am looking to check expression of certain proteins after drug treatment in adherent...
28 January 2019 4,354 10 View
I am using 4-20% biorad precast mini gel and protein ladder is also from biorad. I have attached the image of membrane. Running voltage- 100 V for 1 hr at room temperature and 70 V for 2.30 hr at...
18 December 2018 4,231 5 View
I am solving a numerical modelling stem of autothermal reforming using MATLAB. The problem is ,Pressure and Temperature results are not stable (unsteady state problem) and escalate too much I...
06 July 2018 1,012 1 View
Is it possible to induce site-directed substitution mutation by quick-change method on linear dsDNA? or it has to be cloned in some vector? If yes, should it be treated with the Dpn1 enzyme...
03 March 2021 401 4 View
I have an experiment with 28 participants The independent variable is the times 1, 2, 5, and 10 used as the cross hairs during a task These 4 times were tested using 4 different blocks, each...
03 March 2021 9,692 2 View
I am currently doing my third year design project. I have been assigned to design a glycerol recovery column in vinyl acetate monomer production. The process unit before the recovery column is an...
01 March 2021 9,525 4 View
I am a little confuse with the mechanism of solid lipid nanoparticles (SLNs). The main point of encapsulating drugs into SLNs is because some drugs have low solubility in water. Therefore, SLNs...
01 March 2021 3,703 3 View
Let F be a field. Consider U, the set of n times n strictly upper triangular matrices in F. For X, Y in U, we call them similar if there exists some S, which is non-degenerate and upper...
01 March 2021 2,957 8 View
Also when RHAMM binds hyaluronic acid, they get internalized, will RHAMM also be degraded? Or both CD44 and RHAMM will be transferred back to the cell membrane? Asking for breast cancer cell line...
01 March 2021 8,169 2 View
When explaining substitution models, the substitutions are expressed as Q matrix. Why is the sum of the elements in a row zero?
28 February 2021 3,864 3 View
How would define the "good" and "poor" distribution of particles within the matrix. Is there a quantitative solution to assess the distribution of the particles, which then having denotation of...
28 February 2021 7,397 8 View
Hello, Is it possible to use pUC19 as a transfer vector to be packed in using the second generation viral particles packaging system( pMD2.G; psPAX2 plasmids)? As far as I understand it there is...
28 February 2021 4,868 2 View
Hello. I have a skewed elliptical coordinate system (I use alternative elliptical coordinates). And I need to determine connections between coordinates in order to fetch a covariance matrix of...
28 February 2021 364 3 View