How to store the following Matrix in a variable?
    2 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
    M
 am 15 Sep. 2022
  
    
    
    
    
    Beantwortet: Walter Roberson
      
      
 am 15 Sep. 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 Kommentare
Akzeptierte Antwort
  Walter Roberson
      
      
 am 15 Sep. 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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
				Mehr zu Multidimensional Arrays finden Sie in Help Center und File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

