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

 採用された回答

Andrei Bobrov
Andrei Bobrov 2012 年 2 月 18 日

0 投票

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

1 件のコメント

David Zhang
David Zhang 2012 年 2 月 18 日
thank you, andrei!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Creating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by