Matrix with random integer and defined rank

How can I create a matrix with random integer and defined rank?

Answers (1)

r=1;
while r~=2%desired rank
M=randi(100,3);
r=rank(M);
end

Categories

Products

Asked:

on 7 May 2015

Answered:

on 24 Mar 2022

Community Treasure Hunt

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

Start Hunting!