How to create a random matrix?

5 次查看(过去 30 天)
Anshuman
Anshuman 2022-10-6
评论: Anshuman 2022-10-7
I am creating a SVD matrix UEV*. For that I want to create an E matrix with diagonal enteries in the range of [0,1] and also in increasing order. Can someone kindly suggest me a way to do so!

回答(1 个)

John D'Errico
John D'Errico 2022-10-6
编辑:John D'Errico 2022-10-6
Can you generate a vector of numbers that all lie in the interval [0,1]? (I hope so. read the help for rand.)
Can you insure that vector of numbers lie in increasing order? (Again, I hope so. help sort)
Can you create a diagonal matrix, given a vector? (Again, help diag.)
The point is, when you have a problem that is too big for you to chew on, then break it down into smaller problems. Eat a programming elephant (even a small one) one byte at a time.
  4 个评论
Torsten
Torsten 2022-10-6
编辑:Torsten 2022-10-6
All multiplications are pure matrix multiplications *. No room for elementwise multiplication .*
Anshuman
Anshuman 2022-10-7
Okay thanks for te definitions! Great!

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Operating on Diagonal Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by