how to delete all the elements from the matrix?
    7 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
i want to delete all the elements from the matrix, and make the matrix empty.
1 comentario
  Walter Roberson
      
      
 el 27 de Mzo. de 2014
				What data type is the matrix? Should the empty matrix have the same data type?
Respuestas (3)
  Chandrasekhar
      
 el 27 de Mzo. de 2014
        a = [1 2;3 4]
to make this matrix empty.then
a = [];
0 comentarios
  RAGHAVENDRA
 el 27 de Mzo. de 2014
        
      Editada: RAGHAVENDRA
 el 27 de Mzo. de 2014
  
      Are you trying to make the matrix as null matrix or want to replace the elements with zeros(erasing the values). In the former case just use A=[];
0 comentarios
  Jos (10584)
      
      
 el 27 de Mzo. de 2014
        Several options, depending on the desired result (same class, for instance):
A = []
A(:) = []
A = zeros(0,0,class(A))
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!