how to create matrix using vectors

Hi All, my problems is how to create matrix Aij{n by n} using vector Bi{1 by n} and Cj{1 by n}, where Aij=f(Bi, Cj). I dont like to use the double for loop. is there any fast way to do that?
Thanks

 Réponse acceptée

Andrei Bobrov
Andrei Bobrov le 18 Fév 2012

0 votes

A = bsxfun(f,B.',C) % f = @(x,y)....

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by