I can not create a matrix.
조회 수: 12 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
채택된 답변
Andrei Bobrov
2017년 3월 27일
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;
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!