Filter löschen
Filter löschen

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

2 Ansichten (letzte 30 Tage)
Manoj Kumar
Manoj Kumar am 9 Mai 2019
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 Kommentare
Manoj Kumar
Manoj Kumar am 11 Mai 2019
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 am 11 Mai 2019
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
.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 11 Mai 2019
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

Kategorien

Mehr zu Line Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by