how to create matrix using vectors

3 Ansichten (letzte 30 Tage)
David Zhang
David Zhang am 18 Feb. 2012
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

Akzeptierte Antwort

Andrei Bobrov
Andrei Bobrov am 18 Feb. 2012
A = bsxfun(f,B.',C) % f = @(x,y)....

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by