필터 지우기
필터 지우기

The use of cell array with bsxfun, that would return cell array.

조회 수: 2 (최근 30일)
Mantas Vaitonis
Mantas Vaitonis 2018년 6월 20일
댓글: Joss Knight 2018년 6월 20일
Hello,
I have two cell arrays x1{1x499}(1x5) and x2{1x499}(1x5) with variables of gpuArray and would like to subtract x2 from x1 and should return cell array x3{1x499}(1x5). I can achieve this with cellfun, but it is quite slow, especially when working with bigger arrays. Is there a way to make it work with bsxfun, because it can use multithreads? If I use bsxfun x3=bsxfun(@minus,[x1{:}],[x2{:}]), however it returns array of size (1x2495).
  댓글 수: 8
Mantas Vaitonis
Mantas Vaitonis 2018년 6월 20일
Thank You Adam for the clarification.
Joss Knight
Joss Knight 2018년 6월 20일
bsxfun is mostly redundant now anyway because of implicit scalar dimension expansion. Just use the raw operator.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by