Clear Filters
Clear Filters

how to generate complex random matrix without repetation in matlab?

25 views (last 30 days)
complex matrix should not repeat .
  3 Comments
Walter Roberson
Walter Roberson on 7 Oct 2020
N = 5;
cMatrix = complex(rand(N, N), rand(N,N));
idx = randperm(N,3);
cMatrix(idx(1),:) = cMatrix(idx(2),:) + rand * cMatrix(idx(3),:);
rank(cMatrix)
ans = 4
disp(cMatrix)
0.2452 + 0.6041i 0.1954 + 0.2729i 0.4483 + 0.6054i 0.0907 + 0.2403i 0.2480 + 0.6074i 0.0290 + 0.4051i 0.5763 + 0.3506i 0.3528 + 0.3226i 0.2180 + 0.6163i 0.7613 + 0.3637i 0.8655 + 0.3843i 0.6502 + 0.7220i 0.9093 + 0.6618i 0.4900 + 0.0811i 0.8434 + 0.7145i 0.0805 + 0.3709i 0.6707 + 0.9697i 0.8185 + 0.5859i 0.1826 + 0.7029i 0.2527 + 0.0011i 0.3133 + 0.9175i 0.7620 + 1.0921i 1.1399 + 1.1004i 0.2450 + 0.8342i 0.4615 + 0.6083i

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!