How to store the following Matrix in a variable?
    2 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    M
 el 15 de Sept. de 2022
  
    
    
    
    
    Respondida: Walter Roberson
      
      
 el 15 de Sept. de 2022
            How to store the following Matrix in  the variable C? 
I got the following error
M = ones(7);
C = M(logical(eye(7))) = 0.4
0 comentarios
Respuesta aceptada
  Walter Roberson
      
      
 el 15 de Sept. de 2022
        M = ones(7);
C = M;
C(logical(eye(7))) = 0.4
%or
M = ones(7);
C = M;
C(1:size(C,1)+1:end) = 0.4
%or
M = ones(7);
C = M - 0.6 * eye(size(M))
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Multidimensional Arrays 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!

