How to Find the Determinant of a Matrix in MATLAB using for loop. i don't want to use the actual code.
    8 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    maede mandi
 el 10 de Oct. de 2021
  
    
    
    
    
    Comentada: Walter Roberson
      
      
 el 10 de Oct. de 2021
            How to Find the Determinant of a Matrix in MATLAB using for loop. i don't want to use the actual code.thanks
6 comentarios
Respuesta aceptada
  Walter Roberson
      
      
 el 10 de Oct. de 2021
        
      Editada: Walter Roberson
      
      
 el 10 de Oct. de 2021
  
      if isscalar(YourArray) || isempty(YourArray)
  total = YourArray;
else
    total = 0;
    for R = 1 : number_of_rows
       for C = 1 : number_of_columns
          total = total + SomeValue * YourArray(R,C) * YourDeterminentFunction(YourArray with Row #R and Column #C crossed out)
       end
    end
end
SomeValue is +1 or -1 but you need to figure out which.
2 comentarios
  maede mandi
 el 10 de Oct. de 2021
				
      Editada: Walter Roberson
      
      
 el 10 de Oct. de 2021
  
			
		
  Walter Roberson
      
      
 el 10 de Oct. de 2021
				Use a recursive function.
z(i,j)
Determinents and cofactors are scalar. What is your reasoning for storing something there?
(There are reasons to want to store items as you go through, but I suspect your thoughts are about something else completely.)
Más respuestas (0)
Ver también
Categorías
				Más información sobre Matrix Indexing 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!



