MATLAB Answers

divide 3d matrix (840,64,1536) by 1d matrix (1536,1)

조회 수: 7(최근 30일)
Hello community !
I need help for a simple problem:
I have a matrix A of Dimension (840,64,1536) and a matrix B of dimension (1536,1)
I need to divide each set A(840,64, i ) by the i-th value of B B(i).
I could do a clumpsy for loop, but would like a smarter approach.
Thanky you for your support!
Florian.

  댓글 수: 0

Sign in to comment.

채택된 답변

Stephen Cobeldick
Stephen Cobeldick 7 Feb 2020
bsxfun(@rdivide,A,reshape(B,1,1,[]))

  댓글 수: 0

Sign in to comment.

추가 답변(2개)

Adam
Adam 7 Feb 2020
A ./ reshape( B, [1 1 1536] );

  댓글 수: 0

Sign in to comment.


Florian Bauer
Florian Bauer 7 Feb 2020
Both work perfect !
THANK YOU ! ! !

  댓글 수: 0

Sign in to comment.

제품


릴리스

R2019b

Translated by