Azzera filtri
Azzera filtri

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

2 visualizzazioni (ultimi 30 giorni)
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 Commenti
Manoj Kumar
Manoj Kumar il 11 Mag 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 il 11 Mag 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
.

Accedi per commentare.

Risposte (1)

Walter Roberson
Walter Roberson il 11 Mag 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

Categorie

Scopri di più su Line Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by