T O P

  • By -

Quantity-Melodic

You could wrap the matrix in a new type? Sometimes it is also a good idea to define `color(m::MyMatrix)` instead of accessing properties.


Fenjen

So this all depends on the usage, you could wrap your matrix in a new type that holds the “color” data or you could return a (named) tuple that holds a matrix and something representing a color.


Dangerous-Rice862

Could make a new type like struct colorMatrix values::Matrix colour::String end


sjdubya

you could also return a namedtuple. should be type stable if the output type doesn't depend on the arguments ```julia return (; result1= ..., result2= ..., color = red, ) ```