Elementary Max question/ Iter or not to Iter...?


    Jan 29 2015 | 1:56 pm
    Hi, I have a moment of insane inability to think in Max....
    I need to add a value to individual items in the list. I could do that passing through iter but then the output is no longer a list... I'm sure someone here can help "before the first cup of Earl Grey in pajamas" (Skyfall) :) I appreciate!!!

    • Jan 29 2015 | 2:12 pm
      If you need to add it to all items, use vexpr $f1+$f2 @scalarmode 1
      The @scalarmode 1 attribute lets individual items be treated as if they were a list so inputs of 1 2 3 4 5 and 7 look like 1 2 3 4 5 and 7 7 7 7 7.
      For things that are more complicated (or might add/remove elements) I like this construction, since you don't have to know the length of the list that you want to generate.
    • Jan 29 2015 | 3:29 pm
      Beautiful!!! Thank you thank you thank you, exactly what I needed :) You're the best and you know it...
    • Jan 29 2015 | 3:37 pm
      Maybe Peter is just faster to answer than others. I was 1 minute too late to deserve such a nice compliment :-) But I know I'm not the best anyway.
    • Jan 29 2015 | 3:39 pm
      Patrick thanks so much for responding!!! You guys are awesome!!!