how to create matrix using vectors

조회 수: 3 (최근 30일)
David Zhang
David Zhang 2012년 2월 18일
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일
A = bsxfun(f,B.',C) % f = @(x,y)....

추가 답변 (0개)

카테고리

Help CenterFile 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