Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

calculate matrix from elements of other matrix

조회 수: 2 (최근 30일)
Ilya
Ilya 2015년 11월 19일
마감: Walter Roberson 2015년 11월 19일
Given matrix A = [a(i,j)], what is an efficient and (if possible) concise/readable way to calculate matrix B with elements b(i,j) = a(i,i) - a(i,j)*a(j,i) (or any other such formula)? What currently comes to mind is:
[i, j, ~] = find(A);
b = arrayfun(@(x,y) A(x,x) - A(x,y)*A(y,x), i, j);
b = reshape(b, size(A));

답변 (0개)

제품

Community Treasure Hunt

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

Start Hunting!

Translated by