what bsxfun will perform here?

function Ccode = gen_binary_codes(C, K)
U=mean(C,1);
Ccode =zeros(size(C));
Ccode( bsxfun(@gt, C, K*U) )=1;
This is my code. what bsxfun is performing here?

 Respuesta aceptada

Star Strider
Star Strider el 13 de Nov. de 2018

0 votos

The bsxfun call calculates a vector of logical elements.
If ‘C’ is greater than ‘K*U’, the output is true, and the expression sets the elements of ‘Ccode’ corresponding to those logical true subscripts equal to 1.

2 comentarios

Shan Sha
Shan Sha el 13 de Nov. de 2018
thanks sir
Star Strider
Star Strider el 13 de Nov. de 2018
As always, my pleasure.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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

Etiquetas

Preguntada:

el 13 de Nov. de 2018

Comentada:

el 13 de Nov. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by