Replacing element of a matrix
    4 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
How to replace every n th element of matrix with some number
matrix has vertical shape
and is single row matrix
0 comentarios
Respuestas (1)
  Rik
      
      
 el 25 de Ag. de 2022
        I suspect this is homework, so I'm only going to give you a suggestion:
You should have a look at the colon operator and how you can assign values to an array with indexing.
2:4
A=rand(1,5);
A(4)=5
0 comentarios
Ver también
Categorías
				Más información sobre Resizing and Reshaping Matrices en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

