ASSIGN COMPLEX NUMBERS(X+jY) RANDOM INTEGERS BETWEEN 1 and 3

1 visualización (últimos 30 días)
Herbert Nyakoojo
Herbert Nyakoojo el 11 de Ag. de 2020
Comentada: Herbert Nyakoojo el 14 de Ag. de 2020
I would like to assign a vector of 5 complex numbers random integers (1 2 3)
say;
1 + j 7 has random number 3
-4 + j2 has random number 2
0.3 - j6 has random number 3
4 + j3 has random number 1
9 + j6 has random number 2

Respuestas (1)

KSSV
KSSV el 11 de Ag. de 2020
N = 5 ;
C = zeros(N,1) ;
for i = 1:N
C(i) = randperm(3,1)+1i*randperm(3,1) ;
end
  3 comentarios
KSSV
KSSV el 12 de Ag. de 2020
What do you mean by associate?

Iniciar sesión para comentar.

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by