I’m computing a function that is smooth in some domain and has quite a few fine features somewhere else, so I would like my x variable to have a different resolution in different regions. I’m using range()
for each subdomain, and while doing my numerical explorations and adjusting those ranges I want the computer to automatically remove duplicates and sort the different ranges without worrying about it myself.
I’ve come up with this, but it feels very clumsy,
sort(unique(hcat([collect(range(0.3,1,length=100)),
collect(range(1,3,length=500)),
collect(range(1,10,length=100)),
collect(range(10,100,length=100))]...)))
Am I missing a more straightforward approach? (in Base Julia – I’m asking this to learn better practice, rather than for the end-result).