Switch between nvidia and intel

According to an article on Ask Ubuntu it is possible to switch between nvidia and interl graphics card with these simple commands:

prime-select query
sudo prime-select intel
sudo prime-select nvidia

I shall use this next time when using my notebook without power supply to see if it significantly enhances battery life!