Hi there,
I've created a random 9 times matrix using the command:
P = rand(9,9)
How do I make sure that the rows in each of the matrix are equal to one when added?
Any help will be appreciated!
Thanks

 Respuesta aceptada

Más respuestas (1)

Steven Lord
Steven Lord el 24 de Sept. de 2020

0 votos

>> P = rand(9);
>> NP = normalize(P, 2, 'norm', 1);
>> sum(NP, 2)
ans =
1
1
1
1
1
1
1
1
1

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 24 de Sept. de 2020

Respondida:

el 24 de Sept. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by