I would like to create a list of symbols. I’m currently using the code
[Symbol(“M$i”) for i = 1:10]
I’m wondering if this is the best way to accomplish this or if there is a shorter method, something like
[:M$i for i = 1:10]
Thanks
I would like to create a list of symbols. I’m currently using the code
[Symbol(“M$i”) for i = 1:10]
I’m wondering if this is the best way to accomplish this or if there is a shorter method, something like
[:M$i for i = 1:10]
Thanks
You could do
[Symbol("M", i) for i in 1:10]
or
Symbol.("M", 1:10)
Thanks for the suggestions. I like that second version.