I am given a list
a = {1.1,2.1,3.1,4.1,...}
As you can see this is not a list of the form
{{1.1},{2.1},{3.1},{4.1},...}
Now I was wondering whether it is possible to write a swap function
swap[a,{1,3}]
which would swap the first and third entry such that I get
{3.1,2.1,1.1,4.1,...}
As a result.
Any help will be greatly appreciated !
If it is not possible please just tell me then I'll start looking for other ways to approach this problem.
MinVarGeneralThermal1
is totally irrelevant for the problem at hand, isn't it? You question is merely about reording a given list. $\endgroup$ – Henrik Schumacher Feb 19 '19 at 11:09