sharing values of elements in a matrix

조회 수: 1 (최근 30일)
JL
JL 2019년 8월 8일
댓글: darova 2019년 8월 9일
Hi All, I've attached my questions for your reference - It was hard to paste here.
  댓글 수: 5
Stephen23
Stephen23 2019년 8월 9일
편집: Stephen23 2019년 8월 9일
JL's incorrectly posted "Answer" moved here and formatted correctly:
Hi Darova, what I did was first multiplied W.*Z to get X0
Then I used this code from star strider
for k = 1:size(Y,1)
[~,Zc] = find(Y(k,:) ~= 0, 1, 'last'); % Last Non-Zero Column
Z2(k,:) = Y(k,Zc); % Element Of Last Non-Zero Column
end
Z = accumarray([Z2 Y(:,1)], X0)
Z1 = [Z, zeros(size(Z,1),1 )];
Z2 = [Z.'; zeros(1,size(Z,1 ))];
Znew = Z1 + Z2
With this code, I get
X =
[ 0 0 12.09 11.74;
0 0 11.74 11.74;
12.09 11.74 0 11.74;
11.74 11.74 11.74 0;]
darova
darova 2019년 8월 9일
I think your question is too hard for me

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Delaunay Triangulation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by