Effacer les filtres
Effacer les filtres

how to craet the same function but without loop

1 vue (au cours des 30 derniers jours)
amjad hammad
amjad hammad le 4 Déc 2021
Commenté : amjad hammad le 4 Déc 2021
hi can anyone tell me how i can change this uction to not loop with same result
function Xne = decode( H, Zn0, nIter, verbose )
[ M, N ] = size( H ) ;
ZMN = zeros( M, N ) ;
LMN = zeros( M, N ) ;
for m = 1 : M
ZMN(m,:) = Zn0(:); %must be same like this but without using any loops
end

Réponses (1)

Voss
Voss le 4 Déc 2021
Here is one way:
function Xne = decode( H, Zn0, nIter, verbose )
[ M, N ] = size( H ) ;
LMN = zeros( M, N ) ;
ZMN = repmat(Zn0(:).',M,1);

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by