Chage elements of a matrix
    4 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
I have created a matrix filled with ones with this;
Matrix = ones(5,4)
And I want to change every second element of the matrix with random values how can I do it?
0 Commenti
Risposta accettata
  Chunru
      
      
 il 30 Ago 2022
        Matrix = ones(5,4)
n = numel(Matrix);
Matrix(1:2:n) = randn(size(1:2:n))
0 Commenti
Più risposte (0)
Vedere anche
Categorie
				Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

