How to store the following Matrix in a variable?
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposta accettata
Walter Roberson
il 15 Set 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 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!