Here is the lemmygrad post I made it at (don’t wanna have to copy everything over).

Please give the post lots of heart-sickle, the post would really appreciate it

Don’t be afraid to ask questions.

  • sodium_nitride [any, any]@hexbear.netOP
    link
    fedilink
    English
    arrow-up
    2
    ·
    3 days ago

    Matlab element wise multiplication indeed works in the correct way that you described.

    sum(Leon.*l)

    is equivalent to

    l*Leon

    which is why MatLab’s “sum” function by default sums down columns rather than by rows. The sum(Leon.*l) notation keeps things explicit (helps me in coding consistently), but the MatLab compiler knows how to optimize these things.

    • Sebrof [he/him, comrade/them]@hexbear.net
      link
      fedilink
      English
      arrow-up
      2
      ·
      3 days ago

      Thanks for the response! Hopefully I’m not overloading you with questions - this is helping me understanding MatLab and answering some other questions I had. I’ve asked another question too re. the wages for whenever you have the time.

      Thanks again!