How to store the following Matrix in a variable?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
M
le 15 Sep 2022
Réponse apportée : Walter Roberson
le 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 commentaires
Réponse acceptée
Walter Roberson
le 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Matrices and Arrays dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!