how to create matrix using vectors

3 views (last 30 days)
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

Accepted Answer

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

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!