MATLAB Answers


Is it possible to perform multiplication and update 'val' inside accumarray?

Asked by D_coder on 16 Sep 2018 at 20:50
Latest activity Commented on by D_coder on 17 Sep 2018 at 2:44

An accumarray function is defined as

A = accumarray(subs,val,sz)

I am running accumarray function in a loop , Is it possible to do

val = val.*another_matrix 

inside the accumarray function?


Directly as such, no.

How about a (smallish) example of what you're actually trying to compute? Perhaps an actual example would lead to some alternative methods.

Want to compute this and while loop is called for about 9000 times

while condition 
  val = val.*another_matrix;
  A = accumarray(subs,val,sz)

Sign in to comment.

0 Answers