matlab - Is there a performance difference between array and matrix operators? -
i have several m files wrappers long, complicated equations of sort take more 1 line in journal article. currently, use matrix operators, ie *
,/
,^
. convert them array operators, ie .*
,./
,.^
can vectorize calculations them.
my question is, there reason couldn't search , replace , change of operators? there performance issue multiplying scalars element-wise operators?
i not matter of performance.
if dealing linear algebra expressions, not want search & replace: suppose a = [1; 2; 3]
, b = [4; 5; 6]
, have a'*b
, cannot convert a'.*b
because dimensions not consistent element-wise product (it error).
in case of scalar multiplication, think jit smart enough consider 1*2
, 1.*2
equivalent , interpret them identically.
Comments
Post a Comment