I can not create a matrix.

2 vues (au cours des 30 derniers jours)
Muhendisleksi
Muhendisleksi le 27 Mar 2017
Commenté : Muhendisleksi le 27 Mar 2017
K=[107 719.689 7969.933; 108 342.246 8404.180;23 638.765 8351.331]
KSNKOORD=[8351.311 638.790]
blnmynokta=[23]
YON_BLNM =[23;107;108]
for i = 1:length(YON_BLNM)
for j = 1:(length(blnmynokta))
if YON_BLNM(i) ~= blnmynokta(j)
K1(i,2*j:3*j)= [K(i,2*j) K(i,3*j)]
elseif YON_BLNM(i) == blnmynokta(j)
K1(i,2*j:3*j) = [KSNKOORD(i,1) KSNKOORD(i,1)]
end
end
end
K1=[107 719.689 7969.933; 108 342.246 8404.180;23 638.790 8351.331]
The value in column 2 of line 3 of K1 must be changed. But it does not change. why?

Réponse acceptée

Andrei Bobrov
Andrei Bobrov le 27 Mar 2017
K = [107 719.689 7969.933; 108 342.246 8404.180;23 638.765 8351.331];
KSNKOORD = [8351.311 638.790];
blnmynokta = 23;
K1 = K;
K1(K(:,1) == blnmynokta,2:end) = KSNKOORD;
  1 commentaire
Muhendisleksi
Muhendisleksi le 27 Mar 2017
Thank you very much!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by