필터 지우기
필터 지우기

How to get a constant multiplier of any matrix using same matrix ???

조회 수: 2 (최근 30일)
Manoj Kumar
Manoj Kumar 2019년 5월 9일
댓글: David Goodmanson 2019년 5월 11일
Let A be the m x n matrix.
I need a matrix such that B = k.A or det(B) = k.det(A)
where k is defined as 1 < k < infinite . It can be both integer and non-integer.
  댓글 수: 15
Manoj Kumar
Manoj Kumar 2019년 5월 11일
S. Lord,
I'm truely saying it's not any assignment work given by anybody.
It is my thinking, requirement , when I ploting a matlab code.
I also need such a problem solution. Why I'm asking? Because I thinking anyone who has well understanding of matlab can suggest its solution.
If we able to design such a function using single matrix, in the same time we able to control the response by allowing all matrix properties.
David Goodmanson
David Goodmanson 2019년 5월 11일
per Walter's query, some matrices that are proportional to their inverse.
a) all 2x2 traceless matrices with nonzero determinant
b) rotation matrices by 180 degrees about an arbitrary axis
c) in the following example, to avoid numerical innacuracy (which turned out to be very small anyway) in taking the inverse,
% M*M = k*I --> M = k*inv(M) (assuming inverse exists)
M = [263 106 54 -196 -106
368 -87 12 -132 -112
286 -86 5 -254 86
274 118 -30 -267 -118
286 -86 204 -254 -113]
M*M
ans = 39601 0 0 0 0
0 39601 0 0 0
0 0 39601 0 0
0 0 0 39601 0
0 0 0 0 39601
.

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

답변 (1개)

Walter Roberson
Walter Roberson 2019년 5월 11일
function B = generate_B(A)
maxval = realmax ./ max(abs(A(:)));
while true
k = typecast(randi([0 255], 1, 8, 'uint8'), 'double');
if isfinite(k) && abs(k) <= maxval; break; end
end
B = k * A;
end

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by