how can i separate a matrix into a multiplication of two matrices One of Real Values and the Other for Integer values.
Show older comments
hello,
how can i separate a matrix X into a multiplication of two matrices Y and Z with Y contain Real Values and Z contain Integer values using MATLAB.
such as: X=Y*Z
with:
X= my Input Matrix of NxN.
and i search to obtain:
Y: matrix of integer values.
Z: Matrix of Real Values.
X is suposed to be a NxN matrix.
Accepted Answer
More Answers (1)
Raj
on 8 Jul 2019
There are infinite combinations possible (atleast by theory) in which you can split a real number to multiplication of a real number and an integer. Let me explain:
X=rand(N,N) % your matrix
Y=randi(M,N) % any NxN integer matrix with upper limit as M. INFINITE Possibilities here.
then
Z=X./Y % matrix of real values.
So that you can multiply Y & Z to get back X
X1=Y.*Z
isequal(X,X1) % confirms that X and X1 are equal.
Cheers!!
1 Comment
ahcen aliouat
on 9 Jul 2019
Categories
Find more on Operating on Diagonal Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!